misskey/src/web/serve-app.ts

10 lines
276 B
TypeScript
Raw Normal View History

2016-12-28 23:49:51 +01:00
import * as path from 'path';
import * as express from 'express';
import * as ms from 'ms';
export default (name: string) => (req: express.Request, res: express.Response) => {
res.sendFile(path.resolve(`${__dirname}/app/${name}/view.html`), {
maxAge: ms('7 days')
});
};