-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Public file change
- Loading branch information
Showing
7 changed files
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
const express = require('express'); | ||
const path = require('path'); | ||
require('dotenv').config(); | ||
|
||
const app = express(); | ||
const port = process.env.PORT || 3000; | ||
|
||
// Serve static files from the 'public' directory | ||
app.use(express.static('public')); | ||
|
||
// Send the main index.html file in response to any route not handled above | ||
app.get('*', (req, res) => { | ||
res.sendFile(path.join(__dirname, 'public/index.html')); | ||
}); | ||
|
||
app.listen(port, () => { | ||
console.log(`Server running on port ${port}`); | ||
}); |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.