mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-17 01:50:47 -04:00
18 lines
465 B
JavaScript
18 lines
465 B
JavaScript
const path = require('path');
|
|
const http = require('http');
|
|
const express = require('express');
|
|
const morgan = require('morgan');
|
|
const config = require('./config');
|
|
|
|
const app = express();
|
|
app.use(morgan('dev'));
|
|
app.use(express.json());
|
|
app.use(express.static(config.staticDir));
|
|
app.get('/spectate', (req, res) => {
|
|
res.sendFile(path.join(config.staticDir, 'index.html'));
|
|
});
|
|
|
|
const httpServer = http.createServer(app);
|
|
|
|
module.exports = { app, httpServer };
|