Last active
December 22, 2017 12:39
-
-
Save harrietty/9ad313e43c2389ee1f96113b04b3d2bb to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| function Hexpress () { | |
| this.routeMappings = {}; | |
| }; | |
| Hexpress.prototype.get = function (route, handler) { | |
| this.routeMappings[`GET ${route}`] = handler; | |
| }; | |
| // Usage: | |
| const app = new Hexpress(); | |
| app.get('/api/hexes', (req, res) => res.send('Loads of hexes')); | |
| app.get('/api/cauldrons', (req, res) => res.send('Loads of cauldrons')); | |
| app.listen(3000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment