Core
Versed core provides utilities to bootstrap your microservices.
Server
import { VersedKoaServer } from "@versed/core";
const server = new VersedKoaServer();
const main = async () => {
server.addService(authSpec, new AuthService(), {
basePath: "/v1/auth/",
});
server.start();
};
main().catch(e => {
server.rootCtx.logger.error("FATAL: ", e);
});
Client
import { createVersedAxiosClient } from "@versed/core";
const client = createVersedAxiosClient();
const authService: IAuthService = client.createService<IAuthService>(authSpec);
// use auth service now
authService.Auth(ctx, {});