Initial commit

This commit is contained in:
2023-06-19 15:19:32 +02:00
commit 43eb88b722
16 changed files with 18714 additions and 0 deletions

20
server/index.js Normal file
View File

@ -0,0 +1,20 @@
const express = require("express");
const path = require("path");
const PORT = process.env.PORT || 3001;
const app = express();
app.use(express.static(path.resolve(__dirname, '../client/build')));
app.get("/api", (req, res) => {
res.json({ message: "Hello from server!" });
});
app.get('*', (req, res) => {
res.sendFile(path.resolve(__dirname, '../client/build', 'index.html'));
});
app.listen(PORT, () => {
console.log(`Server listening on ${PORT}`);
});