forked from oat/in-the-database-2
10 lines
200 B
TypeScript
10 lines
200 B
TypeScript
|
import * as fs from 'fs';
|
||
|
|
||
|
export function returnStatic(page) {
|
||
|
return (req, res) => {
|
||
|
fs.readFile(`src/html/${page}`, 'utf8', (err, data) => {
|
||
|
if (err) throw err;
|
||
|
res.send(data);
|
||
|
});
|
||
|
};
|
||
|
}
|