1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2025-01-14 14:43:17 +08:00
pigallery2/backend/routes/PublicRouter.ts

20 lines
612 B
TypeScript
Raw Normal View History

2016-03-18 21:36:58 +01:00
///<reference path="../../typings/main.d.ts"/>
import * as _express from 'express';
import * as _path from 'path';
2016-03-18 21:36:58 +01:00
export class PublicRouter{
constructor(private app){
this.app.use(_express.static(_path.resolve(__dirname, './../../frontend')));
this.app.use('/node_modules',_express.static(_path.resolve(__dirname, './../../node_modules')));
var renderIndex = (req: _express.Request, res: _express.Response) => {
2016-03-20 16:54:30 +01:00
res.sendFile(_path.resolve(__dirname, './../../frontend/index.html'));
};
2016-03-26 19:24:12 +01:00
this.app.get(['/login',"/gallery*"], renderIndex);
2016-03-18 21:36:58 +01:00
}
}