Update server structure

This commit is contained in:
Jake Howard 2016-08-13 16:31:22 +01:00
parent 4ca329d8af
commit 2dfa300d7d
Signed by: jake
GPG key ID: 57AFB45680EDD477
8 changed files with 36 additions and 11 deletions

View file

@ -1,3 +1,6 @@
{
"extends": "./node_modules/eslint-config/.eslintrc"
"extends": "./node_modules/eslint-config/.eslintrc",
"env": {
"node": true
}
}

2
.gitignore vendored
View file

@ -31,5 +31,3 @@ node_modules
# Optional REPL history
.node_repl_history
site/

View file

@ -1,4 +1,4 @@
# host-container
# host-container [![CircleCI](https://circleci.com/gh/RealOrangeOne/host-container/tree/master.svg?style=svg)](https://circleci.com/gh/RealOrangeOne/host-container/tree/master)
Container to host simple static applications using a node server, so files can be deployed using rsync
## Why is this a thing?

View file

@ -1 +0,0 @@
NODE_ENV=production

View file

@ -1 +0,0 @@
web: npm start

View file

@ -5,9 +5,11 @@
"main": "server.js",
"scripts": {
"test": "eslint server.js",
"postinstall": "mkdir -p site/",
"start": "node server.js"
},
"engines": {
"node": "5.11.1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/RealOrangeOne/host-container.git"
@ -18,7 +20,7 @@
},
"homepage": "https://github.com/RealOrangeOne/host-container#readme",
"dependencies": {
"express": "=4.13.3"
"express": "=4.14.0"
},
"devDependencies": {
"eslint": "=1.9.0",

View file

@ -7,7 +7,7 @@ const directory = /\/$/;
const allFiles = /.*/;
const expressConfig = {
dotfiles: 'deny',
dotfiles: 'ignore',
index: false,
redirect: true
};
@ -32,6 +32,5 @@ app.use(
);
const server = app.listen(PORT, function () {
const serverPort = server.address().port;
console.log('Server started on port ' + serverPort);
console.log('Server started on port ' + server.address().port);
});

25
site/index.html Normal file
View file

@ -0,0 +1,25 @@
<!DOCTYPE html>
<html>
<head>
<title>Oops!</title>
<style type="text/css">
body {
width: 75%;
padding-top: 50px;
margin: 0 auto;
text-align: center;
font-family: "Trebuchet MS", Helvetica, Arial, sans-serif;
font-size: 80%;
color: #333;
}
h1 {
margin: 30px 0;
}
</style>
</head>
<body>
<h1>Something's not right!</h1>
<p><strong>Sorry!</strong> Something has gone wrong while handling your request. Please try again later.</p>
</body>
</html>