Browse Source

autodeploy

pull/143/head
Francesca Sperati 7 years ago
parent
commit
6b90799b4e
2 changed files with 17 additions and 5 deletions
  1. +5
    -5
      package.json
  2. +12
    -0
      server.js

+ 5
- 5
package.json View File

@ -4,7 +4,7 @@
"private": true,
"description": "HTML Admin Template",
"scripts": {
"start": "webpack-dev-server",
"start": "npm run build && node server.js",
"dev": "webpack-dashboard -t 'Project' -- webpack-dev-server",
"clean": "shx rm -rf ./build",
"build": "npm run clean && cross-env NODE_ENV=\"production\" webpack",
@ -14,6 +14,8 @@
"lint": "npm run lint:js && npm run lint:scss"
},
"devDependencies": {
},
"dependencies": {
"babel-core": "^6.26.0",
"babel-eslint": "^8.0.1",
"babel-loader": "^7.1.2",
@ -43,9 +45,7 @@
"stylelint-config-standard": "^17.0.0",
"webpack": "^3.8.1",
"webpack-dashboard": "^1.0.0",
"webpack-dev-server": "^2.9.3"
},
"dependencies": {
"webpack-dev-server": "^2.9.3",
"babel-polyfill": "^6.26.0",
"bootstrap": "^4.0.0",
"bootstrap-datepicker": "^1.7.1",
@ -65,4 +65,4 @@
"popper.js": "^1.12.6",
"skycons": "^1.0.0"
}
}
}

+ 12
- 0
server.js View File

@ -0,0 +1,12 @@
const express = require('express');
const app = express();
app.use(express.static('public'));
// start the server with the build folder.
app.use('/', express.static(__dirname + '/build'));
const server = app.listen(process.env.PORT || 3000, function () {
console.log('Server started at http://localhost:%s', server.address().port);
});

Loading…
Cancel
Save