Skip to content

Instantly share code, notes, and snippets.

@zaiste
Created April 24, 2019 16:48
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 zaiste/ea898a317c04a73daf84d6ad9142817a to your computer and use it in GitHub Desktop.
Save zaiste/ea898a317c04a73daf84d6ad9142817a to your computer and use it in GitHub Desktop.
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