clean initial commit
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
const express = require('express');
|
||||
const cookieParser = require('cookie-parser');
|
||||
const path = require('path');
|
||||
const routes = require('./src/routes');
|
||||
const { router: filesRouter } = require('./src/files');
|
||||
|
||||
const app = express();
|
||||
const PORT = 3010;
|
||||
|
||||
app.use(express.json());
|
||||
app.use(cookieParser());
|
||||
app.use(express.static(path.join(__dirname, 'public')));
|
||||
app.use('/api', routes);
|
||||
app.use('/api/files', filesRouter);
|
||||
|
||||
const html = f => (req, res) => res.sendFile(path.join(__dirname, 'public', f));
|
||||
|
||||
app.get('/login', html('login.html'));
|
||||
app.get('/admin', html('admin.html'));
|
||||
app.get('/datenschutz', html('datenschutz.html'));
|
||||
app.get('/{*path}', html('index.html'));
|
||||
|
||||
app.listen(PORT, '127.0.0.1', () => console.log(`info1 läuft auf :${PORT}`));
|
||||
Reference in New Issue
Block a user