@nicolasparada/static-middleware
v0.1.2
Published
Serve static content middleware
Downloads
2
Readme
@nicolasparada/static-middleware
Middleware to serve static content.
Usage
const framework = require('@nicolasparada/web-framework')
const static = require('@nicolasparada/static-middleware')
const path = require('path')
const middlewares = [
static.serve(path.join(__dirname, 'dist')),
static.fallback(path.join(__dirname, 'dist', 'index.html'))
]
const app = framework(middlewares)
app.listen(80, '127.0.0.1', () => {
console.log('Server running at http://localhost/ 🚀')
})