Skip to content

Commit

Permalink
Update server.js
Browse files Browse the repository at this point in the history
  • Loading branch information
woshiJay committed Mar 22, 2024
1 parent ef03a34 commit 2445738
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion server.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
const express = require("express");
const path = require("path");
const fetch = require("node-fetch");
const cors = require("cors");
const app = express();
const port = 5501;
const port = process.env.PORT || 5501;

app.use(express.json());
app.use(cors());

// Serve static files from the src directory
app.use(express.static(path.join(__dirname, 'src')));

// Catch-all handler for any request that doesn't match one above
app.get('*', (req, res) =>{
res.sendFile(path.join(__dirname, 'src', 'index.html'));
});


// ----------------------------------------------------------------------
// Database Routes
// ----------------------------------------------------------------------
Expand Down

0 comments on commit 2445738

Please sign in to comment.