MortezaExpress in a lightweight and simple framework for building web applications with node js.
- Simple routing
- Strongly typed
- Serving static files
Install this package using
npm install mortezaexpress
Here's the examplw of using mortezaexpress:
const express=require('mortezaexpress')
const app=express()
app.get('/',(req,res,next)=>{
res.json({
message:'Hello World'
})
})
app.listen(8000,()=>{
console.log('app is running');
})
For serving static files you can use:
const mortezaexpess=require("mortezaexpress")
app.use(mortezaexpress("public"))
You can add middlewares using:
app.use((req,res,next)=>{
console.log('middleware');
next()
})