wip
This commit is contained in:
parent
2b71549feb
commit
66ced29c6d
28 changed files with 477 additions and 965 deletions
31
src/server.ts
Normal file
31
src/server.ts
Normal file
|
@ -0,0 +1,31 @@
|
|||
import bodyParser from 'koa-bodyparser';
|
||||
import serve from 'koa-static';
|
||||
import mount from 'koa-mount';
|
||||
import { createKoaServer } from 'routing-controllers';
|
||||
|
||||
import constant from './const';
|
||||
import { config } from './config';
|
||||
import controllers from './controllers';
|
||||
|
||||
import 'reflect-metadata';
|
||||
|
||||
export default (): void => {
|
||||
const app = createKoaServer({
|
||||
controllers,
|
||||
routePrefix: '/api/v1',
|
||||
});
|
||||
|
||||
console.log('Misshaialert v' + constant.version);
|
||||
|
||||
console.log('Initializing DB connection...');
|
||||
|
||||
app.use(bodyParser());
|
||||
app.use(mount('/assets', serve(__dirname + '/../assets')));
|
||||
|
||||
app.keys = [ '人類', 'ミス廃化', '計画', 'ここに極まれり', 'フッフッフ...' ];
|
||||
|
||||
console.log(`listening port ${config.port}...`);
|
||||
console.log('App launched!');
|
||||
|
||||
app.listen(config.port || 3000);
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue