ログインできた
This commit is contained in:
parent
326384957c
commit
dfbc06f858
18 changed files with 853 additions and 167 deletions
30
src/server.ts
Normal file
30
src/server.ts
Normal file
|
@ -0,0 +1,30 @@
|
|||
import 'reflect-metadata';
|
||||
|
||||
import Koa from 'koa';
|
||||
import bodyParser from 'koa-bodyparser';
|
||||
import serve from 'koa-static';
|
||||
import mount from 'koa-mount';
|
||||
|
||||
import constant from './const';
|
||||
import { router } from './router';
|
||||
import { render } from './render';
|
||||
import { config } from './config';
|
||||
|
||||
export default (): void => {
|
||||
const app = new Koa();
|
||||
|
||||
console.log('Misshaialert v' + constant.version);
|
||||
|
||||
console.log('Initializing DB connection...');
|
||||
|
||||
|
||||
app.use(bodyParser());
|
||||
app.use(render);
|
||||
app.use(mount('/assets', serve(__dirname + '/assets')));
|
||||
app.use(router.routes());
|
||||
|
||||
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