@antibot/server
v1.1.3
Published
## 🖥️💫 A quick express backend module.
Downloads
20
Maintainers
Readme
Server
🖥️💫 A quick express backend module.
npm i @antibot/server
yarn add @antibot/server
const path = require("path");
const { Server } = require("@antibot/server");
const server = new Server({
port: 3000,
settings: {
routesDirectory: path.join(process.cwd(), "/tests/routes/"),
routesEndpoint: "/api",
debug: true,
},
cors: {
origin: "*",
methods: "GET,HEAD,PUT,PATCH,POST,DELETE",
},
});
server.start();
Routes
const { Router } = require("@antibot/server");
const router = Router();
router.get("/hello", (req, res) => {
res.send("Hello World!");
});
exports.default = router;