2025-02-13 15:56:29 -05:00
|
|
|
const express = require('express');
|
|
|
|
const path = require('path');
|
|
|
|
const dotenv = require('dotenv');
|
|
|
|
|
|
|
|
dotenv.config();
|
|
|
|
|
|
|
|
const app = express();
|
|
|
|
const PORT = 3000; //TODO DO NOT HARDCODE THIS
|
|
|
|
|
|
|
|
// Middleware
|
|
|
|
app.use(express.static(path.join(__dirname, 'public')));
|
|
|
|
app.use(express.json());
|
|
|
|
|
|
|
|
|
|
|
|
// Routes
|
2025-02-14 08:27:28 -05:00
|
|
|
const generateRoute = require('./routes/generate');
|
|
|
|
app.use('/generate', generateRoute);
|
2025-02-13 15:56:29 -05:00
|
|
|
|
2025-02-22 06:31:01 -05:00
|
|
|
app.get('/env', (req,res) => {
|
|
|
|
res.json({TEST_MODE: process.env.TEST_MODE || false})
|
|
|
|
})
|
|
|
|
|
2025-02-13 15:56:29 -05:00
|
|
|
app.listen(PORT, () => {
|
|
|
|
console.log(`Server running on http://localhost:${PORT}`);
|
|
|
|
});
|
|
|
|
|