controller-express
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

Example:

import express from "express"

import { Controller } from "controller-express"

const AppController = Controller({
    "GET /"(req, res) {
        res.send("home")
    },
    "GET /user/:id"(req, res) {
        res.send({
            id: req.params.id
        })
    },
    "POST /"(req, res) {
        res.send("only post allowed")
    }
})

const app = express()

app.use(AppController)

app.start(8000)

/controller-express/

    Package Sidebar

    Install

    npm i controller-express

    Weekly Downloads

    0

    Version

    0.0.1

    License

    MIT

    Unpacked Size

    2.46 kB

    Total Files

    5

    Last publish

    Collaborators

    • danybeltran