Shardy · Unity client · Report Bug
This is a template for Shardy service.
Shardy is a framework for online games and applications on Node.js. It provides the basic functionality for building microservices solutions: mobile, social, web, multiplayer games, realtime applications, chats, middleware services, etc.
It's really easy to start developing your project with Shardy:
- Clone a service template or creare a new one
git clone git@github.com:mopsicus/shardy-template.git
- Install Shardy and all dependencies:
npm install
- Edit
.env.dev
- Run debug mode
npm run debug
- App started
- Validator stub
- Simple serializer
- Service example
- Requests/commands examples
- Commands loader
See the Shardy documentation for all API methods and examples.
There are a few examples in template that show how to use Shardy API with bot. Also, template includes simple validation and serialization examples.
// fetch
const response = await this.bot.fetch('status');
this.bot.log.info(`test fetch answer: ${response.data}`);
// request
this.bot.request('status', (response) => {
this.bot.log.info(`test request answer: ${response.data}`);
});
// request with data
this.bot.request('status', (response) => {
this.bot.log.info(`test request with data, answer: ${response.data}`);
}, Buffer.from('request_data'));
// request with fail
this.bot.request('fail', (response) => {
if (response.error.length > 0) {
this.bot.log.error(`test request fail: ${response.data}`);
}
});
// command
this.bot.command('notify');
// command with data
this.bot.command('notify', Buffer.from('command_data'));
You can support Shardy by using any of the ways below:
- Bitcoin (BTC): 1VccPXdHeiUofzEj4hPfvVbdnzoKkX8TJ
- USDT (TRC20): TMHacMp461jHH2SHJQn8VkzCPNEMrFno7m
- TON: UQDVp346KxR6XxFeYc3ksZ_jOuYjztg7b4lEs6ulEWYmJb0f
- Visa, Mastercard via Boosty
- MIR via CloudTips
Before you ask a question, it is best to search for existing issues that might help you. Anyway, you can ask any questions and send suggestions by email or Telegram.
Template for Shardy is licensed under the MIT License. Use it for free and be happy. 🎉