Created
June 17, 2020 15:29
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
manifest: { | |
webRoot: "./dist" | |
}, | |
middleware: [ | |
(req, res, next) => { | |
// an amazing logger middleware. wow. | |
console.log(`${req.method} ${req.url}`) | |
next() | |
} | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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 <[email protected]> (https://lucas.dohmen.io)" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment