Created
April 24, 2019 16:48
-
-
Save zaiste/ea898a317c04a73daf84d6ad9142817a to your computer and use it in GitHub Desktop.
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
const Szelmostwo = require('./'); | |
const { ok, json, created } = require('./response'); | |
const { serve, security } = require('./middleware'); | |
const app = new Szelmostwo(); | |
app.get( | |
'/', | |
security(), | |
async ({ params }) => `Hello, uWS -> ${JSON.stringify(params)}` | |
); | |
app.get('/throw', async ({ params }) => { | |
throw 'Bajlango'; | |
}); | |
app.get('/foo/*', serve('static/'), async _ => `foo for life`); | |
app.listen(4455); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment