Created
March 23, 2022 17:55
-
-
Save jfhbrook/2e59a7ca9d24b77d02c553061e3acac1 to your computer and use it in GitHub Desktop.
Sketch of an API for a javascript proxy layer
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 = ({ forward, listen, match, proxy, whenever }) => { | |
// dokuwiki | |
listen(80, () => { | |
whenever(match('/'), | |
forward('localhost', 8080) | |
); | |
}); | |
// pulp | |
listen(24816, () => { | |
forward('localhost', 24816); | |
}); | |
// api for handling side effects, "embedded apps" etc | |
/* | |
* handle('pull some shenanigans', (req, res) => { | |
* // a side effect, basically | |
* }); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment