Asymptote Club Account Manager: LDAP account manager, made for Asymptote Club https://account.asymptote.club/
ldap
made-for-asymptote
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.ts 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. LDAP account manager, made for Asymptote Club
  3. Copyright (C) 2018 Zebulon McCorkle and Asymptote Club contributors
  4. This program is free software: you can redistribute it and/or modify
  5. it under the terms of the GNU Affero General Public License as published by
  6. the Free Software Foundation, either version 3 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU Affero General Public License for more details.
  12. You should have received a copy of the GNU Affero General Public License
  13. along with this program. If not, see <http://www.gnu.org/licenses/>.
  14. */
  15. import { join } from 'path';
  16. import * as Koa from 'koa';
  17. import * as session from 'koa-session';
  18. import * as serve from 'koa-static';
  19. import * as mount from 'koa-mount';
  20. import * as bodyParser from 'koa-bodyparser';
  21. import * as createDebug from 'debug';
  22. const debug = createDebug('asymptote:account:index');
  23. import router from './routes';
  24. const app = new Koa();
  25. app.use(bodyParser());
  26. app.use(router.routes());
  27. app.use(router.allowedMethods());
  28. app.use(mount('/static', serve(join(__dirname, '..', 'static'))));
  29. const port = process.env.PORT ? parseInt(process.env.PORT, 10) : 3000;
  30. app.listen(port, () => debug('Listening on port', port));