Visitar URL original
squzy_node/packages/express at master · squzy/squzy_node · GitHub
Skip to content

Latest commit

 

History

History

express

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

@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')
})