Skip to content

Commit

Permalink
step 2: setup express server
Browse files Browse the repository at this point in the history
  • Loading branch information
kchia committed Jun 24, 2020
1 parent 69be457 commit cac665f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/index.js
@@ -0,0 +1,12 @@
const express = require('express');
const path = require('path');

const app = express();

const publicDirectoryPath = path.join(__dirname, '../public');
app.use(express.static(publicDirectoryPath));

const port = process.env.PORT || 8080;
app.listen(port, () => {
console.log(`Server is up on port ${port}.`);
});

0 comments on commit cac665f

Please sign in to comment.