Apis
@zely-js/core
Core.createZelyServer()
core.createZelyServer()
Creates a server instance.
Typescript
const { server, cache, applyZelyMiddlewares } = await createZelyServer({});
#Server.server
This is the main server, created using Zely's custom server library.
Typescript
server.use((ctx, next) => {
next();
});
server.server.listen(3000);
#Server.cache
This is the module cache manager. It manages and updates compiled JavaScript/TypeScript modules.
Typescript
cache.getModule('/'); // loads pages/index.{ts,js} file
#Server.applyZelyMiddlewares()
Applies Zely’s core middlewares to the server.
Typescript
import { App } from 'senta';
const app = new App({});
process.env.NODE_ENV = 'development';
// ...
applyZelyMiddlewares(app);
WARNING
Based on some experiments, it has been confirmed that backend libraries such as Koa and Hono are not compatible. Please consider copying and modifying the code from the zely base server library to create a custom server.