diff options
author | William Harrington <kb0iic@berzerkula.org> | 2019-04-17 21:12:48 -0500 |
---|---|---|
committer | William Harrington <kb0iic@berzerkula.org> | 2019-04-17 21:12:48 -0500 |
commit | 7693b644180745beca027e3d0fe771786f961e8c (patch) | |
tree | 5c5b15964254b64d82ff88010db453efdb6e603e | |
parent | 22a992855dbfa09760204bf8f69075bb1a143e18 (diff) |
Add static directory
-rw-r--r-- | index.js | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -3,9 +3,8 @@ const path = require('path'); const app = express(); -app.get('/', (req, res) => { - res.sendFile(path.join(__dirname, 'public', 'index.html')); -}); +// Set static directory +app.use(express.static(path.join(__dirname, 'public'))); const PORT = process.env.PORT || 3000; |