Skip to content

Commit

Permalink
Merge pull request #4 from remedcu/frontend
Browse files Browse the repository at this point in the history
Frontend for V2.4.4.
  • Loading branch information
remedcu committed Nov 13, 2020
2 parents 6ffcab5 + 47f488f commit 31240d0
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"documentation": "solidity-docgen --solc-module ./node_modules/solc",
"test": "truffle test --network development",
"coverage": "truffle run coverage --file='test/*.test.js' --network coverage",
"start": "webpack-dev-server"
"start": "node server.js",
"heroku-postbuild": "truffle compile && webpack -p"
},
"repository": {
"type": "git",
Expand Down
20 changes: 20 additions & 0 deletions server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const express = require('express');
const path = require('path');
const port = process.env.PORT || 8080;
const app = express();

// the __dirname is the current directory from where the script is running
app.use(express.static(__dirname + '/public'));

// send the user to index html page inspite of the url
app.get('/', (req, res) => {
res.sendFile(path.resolve(__dirname, 'index.html'));
});
app.get('/deploy.html', (req, res) => {
res.sendFile(path.resolve(__dirname, 'deploy.html'));
});
app.get('/interact.html', (req, res) => {
res.sendFile(path.resolve(__dirname, 'interact.html'));
});

app.listen(port);

0 comments on commit 31240d0

Please sign in to comment.