https://github.com/atomic-state/controller-express
Router wrapper for Express
https://github.com/atomic-state/controller-express
controller express http request
Last synced: 7 months ago
JSON representation
Router wrapper for Express
- Host: GitHub
- URL: https://github.com/atomic-state/controller-express
- Owner: atomic-state
- License: mit
- Created: 2022-06-09T23:51:35.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-06-09T23:52:56.000Z (almost 4 years ago)
- Last Synced: 2025-07-28T22:46:19.241Z (8 months ago)
- Topics: controller, express, http, request
- Language: JavaScript
- Homepage:
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Example:
```js
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)
```