Skip to content

Instantly share code, notes, and snippets.

@moonglum
Created June 17, 2020 15:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moonglum/668f25c6ff961f2ea272f9d134c4e0c3 to your computer and use it in GitHub Desktop.
Save moonglum/668f25c6ff961f2ea272f9d134c4e0c3 to your computer and use it in GitHub Desktop.
experimental middleware feature in faucet. To see it work, create a folder `dist` with some files you want to serve.
module.exports = {
manifest: {
webRoot: "./dist"
},
middleware: [
(req, res, next) => {
// an amazing logger middleware. wow.
console.log(`${req.method} ${req.url}`)
next()
}
]
}
{
"name": "oro",
"version": "1.0.0",
"dependencies": {
"faucet-pipeline-core": "faucet-pipeline/faucet-pipeline-core#middleware",
"live-server": "^1.2.1"
},
"devDependencies": {},
"scripts": {
"start": "faucet --liveserve 0.0.0.0:8080"
},
"author": "Lucas Dohmen <lucas@dohmen.io> (https://lucas.dohmen.io)"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment