1
0
mirror of https://github.com/bpatrik/pigallery2.git synced 2025-01-20 04:59:33 +02:00
pigallery2/backend/routes/PublicRouter.ts
2016-03-19 17:31:42 +01:00

20 lines
608 B
TypeScript

///<reference path="../../typings/main.d.ts"/>
import * as _express from 'express';
import * as _path from 'path';
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) => {
res.sendFile(_path.resolve(__dirname, './../frontend/index.html'));
};
this.app.get(['/login',"/gallery"], renderIndex);
}
}