this works, to the extent that i tested it
This commit is contained in:
29
index.js
Normal file
29
index.js
Normal file
@@ -0,0 +1,29 @@
|
||||
import express from 'express';
|
||||
import bodyParser from 'body-parser';
|
||||
import helmet from 'helmet';
|
||||
import cookieParser from 'cookie-parser';
|
||||
import dotenv from 'dotenv';
|
||||
import path from 'path';
|
||||
import { fileURLToPath } from 'url';
|
||||
dotenv.config();
|
||||
|
||||
import webhookRouter from './routes/webhook.js';
|
||||
import execRouter from './routes/exec.js';
|
||||
|
||||
import { info } from './util/Console.js';
|
||||
|
||||
const app = express();
|
||||
app.use(helmet());
|
||||
app.use(bodyParser.json());
|
||||
app.use(cookieParser());
|
||||
app.use(express.static('public'));
|
||||
|
||||
app.use('/webhook', webhookRouter);
|
||||
app.use('/exec', execRouter);
|
||||
|
||||
const PORT = process.env.PORT || 3000;
|
||||
const HOST = process.env.BIND_ADDRESS || '0.0.0.0';
|
||||
|
||||
app.listen(PORT, HOST, () => {
|
||||
info(`API listening on ${HOST}:${PORT}`);
|
||||
});
|
||||
Reference in New Issue
Block a user