Organized
This commit is contained in:
parent
b2dcc571c2
commit
93fe5f2260
@ -5,7 +5,7 @@
|
|||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
"start": "node src/main.js"
|
||||||
},
|
},
|
||||||
"author": "",
|
"author": "",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
@ -12,7 +12,7 @@ export default class Http extends Controller {
|
|||||||
this.express.get('*', (req, res) => {
|
this.express.get('*', (req, res) => {
|
||||||
let p = req.params['0'];
|
let p = req.params['0'];
|
||||||
if(!p || p == '/') p = 'index.html';
|
if(!p || p == '/') p = 'index.html';
|
||||||
const absolute = path.join(import.meta.url, '/../', p).replace('file:', '');
|
const absolute = path.join(import.meta.url, '/../../ui/', p).replace('file:', '');
|
||||||
res.sendFile(absolute);
|
res.sendFile(absolute);
|
||||||
});
|
});
|
||||||
this.express.get('/api/*', async (req, res) => {
|
this.express.get('/api/*', async (req, res) => {
|
Loading…
Reference in New Issue
Block a user