npm.io
1.10.0 • Published 6 years ago

@squzy/express

Licence
ISC
Version
1.10.0
Deps
3
Size
6 kB
Vulns
0
Weekly
0

@squzy/express

Package for usage that inside express application

How to use

npm install @squzy/express --save

It is should be on route level, because on root level it is impossible to get access to matched router without patching(we dont wanna do that)

import { createMiddleware } from "@squzy/express"
import { createApplication } from "@squzy/core"

const application = await createApplication({
    apiHost: "http://localhost:8080",
    name: "nodejs"
})

const router = express.Router();

router.get('/adamin/:name', createMiddleware(application), function (req, res) {
    //console.log(req.route)
    res.send('hello world')
})