routes.js 769 B

12345678910111213141516171819
  1. const choo = require('choo');
  2. const download = require('./ui/download');
  3. const body = require('./ui/body');
  4. module.exports = function(app = choo({ hash: true })) {
  5. app.route('/', body(require('./ui/home')));
  6. app.route('/download/:id', body(download));
  7. app.route('/download/:id/:key', body(download));
  8. app.route('/unsupported/:reason', body(require('./ui/unsupported')));
  9. app.route('/legal', body(require('./ui/legal')));
  10. app.route('/error', body(require('./ui/error')));
  11. app.route('/blank', body(require('./ui/blank')));
  12. app.route('/oauth', function(state, emit) {
  13. emit('authenticate', state.query.code, state.query.state);
  14. });
  15. app.route('/login', body(require('./ui/home')));
  16. app.route('*', body(require('./ui/notFound')));
  17. return app;
  18. };