forked from microsoft/rating-web
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
37 additions
and
778 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
var path = require("path"); | ||
var express = require("express"); | ||
|
||
var DIST_DIR = path.join(__dirname, "dist"); | ||
var STATIC_DIR = path.join(__dirname, "static"); | ||
var PORT = 3000; | ||
var app = express(); | ||
|
||
//Serving the files on the dist folder | ||
app.use(express.static(DIST_DIR)); | ||
app.use("/static",express.static(STATIC_DIR)); | ||
|
||
app.use(function(req, res, next) { | ||
var err = new Error('Not Found'); | ||
err.status = 404; | ||
next(err); | ||
}); | ||
|
||
//Send index.html when the user access the web | ||
app.get("*", function (req, res) { | ||
res.sendFile(path.join(DIST_DIR, "index.html")); | ||
}); | ||
|
||
app.use(function(err, req, res, next) { | ||
res.locals.message = err.message; | ||
res.locals.error = req.app.get('env') === 'development' ? err : {}; | ||
|
||
// render the error page | ||
res.status(err.status || 500); | ||
}); | ||
|
||
app.listen(PORT); | ||
|
||
module.exports = app; |
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,15 +4,16 @@ | |
"description": "Rating front-end", | ||
"author": "Joey Schluchter <[email protected]>", | ||
"scripts": { | ||
"build": "webpack", | ||
"build": "webpack -p", | ||
"postinstall": "npm run build", | ||
"start": "webpack-dev-server" | ||
"start": "NODE_ENV='development' node app.js" | ||
}, | ||
"dependencies": { | ||
"at-ui": "^1.2.0-beta", | ||
"at-ui-style": "^1.3.2", | ||
"axios": "^0.19.0", | ||
"compression-webpack-plugin": "^1.1.3", | ||
"express": "^4.17.1", | ||
"numeral": "^2.0.6", | ||
"vue": "^2.3.4", | ||
"webpack": "^3.0.0", | ||
|