Skip to content

Instantly share code, notes, and snippets.

@walidum
Created April 30, 2021 17:56
Show Gist options
  • Save walidum/3eb59c5c683814db0a1b3939bb6751c9 to your computer and use it in GitHub Desktop.
Save walidum/3eb59c5c683814db0a1b3939bb6751c9 to your computer and use it in GitHub Desktop.
node express server
const express = require('express');
const path = require('path');
const app = express();
app.use(express.static(__dirname + '/dist/<FOLDER_NAME>'));
app.get('/*', (req,res,next) => {
res.sendFile(path.join(__dirname + '/dist/dictionary/index.html'));
});
app.listen(process.env.PORT || 8000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment