@dkaframework/server combines other frameworks into a framework and can be used practically to create your project. It consists of:
- a Fastify - Fast and low overhead web framework, for Node.js
- a Socket.io - real-time bidirectional event-based communication
- a Node:dgram - UDP Server - an udp core udp protocol send files
Sample code:
import {Server, Options} from "@dkaframework/server";
(async() => {
await Server({
engine: Options.ENGINE.FASTIFY, // Options.ENGINE.SOCKETIO || Options.ENGINE.UDP,
host: Options.HOST.LOCALHOST, // Options.HOST.WILDCARD
port: Options.PORT.DEFAULT,
... // Optional Config if you change engine type
}).then(async (serverCallback) => {
console.log(serverCallback)
}).catch(async (error) => {
console.error(error)
});
})()