feat: use /api routes properly
This commit is contained in:
@@ -12,6 +12,7 @@ import cookieParser from 'cookie-parser';
|
|||||||
import csrf from 'csurf';
|
import csrf from 'csurf';
|
||||||
import { SERVER_PORT } from "./constants/config";
|
import { SERVER_PORT } from "./constants/config";
|
||||||
import { Server } from "socket.io";
|
import { Server } from "socket.io";
|
||||||
|
import { readdirSync } from "fs"
|
||||||
|
|
||||||
const csrfProtection = csrf({ cookie: true })
|
const csrfProtection = csrf({ cookie: true })
|
||||||
|
|
||||||
@@ -48,6 +49,8 @@ app.use('/auth', auth);
|
|||||||
app.use('/integration', integration);
|
app.use('/integration', integration);
|
||||||
app.use('/proxy', proxy);
|
app.use('/proxy', proxy);
|
||||||
|
|
||||||
|
readdirSync('./api').map(r => app.use('/api', require(`./api/${r}`)))
|
||||||
|
|
||||||
app.get('/', function (req, res) {
|
app.get('/', function (req, res) {
|
||||||
return res.send('Maxun server started 🚀');
|
return res.send('Maxun server started 🚀');
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user