@dekproject/routes

1.1.0 • Public • Published

@dekproject/routes

Express route controller for DEK

Install

import express from "express";
import dotenv from "dotenv";

import { $, plugins, controllers } from "@dekproject/scope";
import { routes } from "@dekproject/routes";

(async () => {
    dotenv.config();

    $.set("app", express());
    $.app.use(await routes(process.env.ROUTES_PATH || "src/routes"));

    const PORT = process.env.PORT || 5555;

    $.app.listen(PORT, () => {
        console.log(`App listening on port ${PORT}!`);
    });
})();

src/routes/index.js

export default async (router) => {
    router.get('/', (req, res) => {
        res.send("Hello World").end();
    });
}

Readme

Keywords

Package Sidebar

Install

npm i @dekproject/routes

Weekly Downloads

0

Version

1.1.0

License

MIT

Unpacked Size

7.54 kB

Total Files

7

Last publish

Collaborators

  • gislainyvelasco
  • andrehrf