Lightos is a Node.js template for building small microservice architectures fast. I provide you only the source, and so that you can flexibly customize it with your own preferences.
sendHelloRoute: {
method: "get",
path: "/hello",
middleware: [
(req, res, next) => UserController.sendHelloController(req, res, next),
],
}
// ...
Object.entries(cookies).forEach(([key, value]) => {
res.cookie(key, value, {
expires: value.expires ? value.expires : new Date(Date.now() + 900000),
httpOnly: value.httpOnly ? value.httpOnly : true,
signed: value.signed ? value.signed : true,
});
});
// ...
applyRoutes() {
this.#app.use(getRoutes()); // all routes are applied here
this.routes = getRoutes();
this.#app.use("/api", this.routes, cookiesPostHandler, sendPostHandler);
}
applyPostHandlers() {
this.#app.use(errorsPostHandler);
}
// ...
git clone ...
cd lightos/src/
npm run dev
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.