archive
/
tstatic
Archived
1
Fork 0

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 # Optional REPL history
.node_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 Container to host simple static applications using a node server, so files can be deployed using rsync
## Why is this a thing? ## 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", "main": "server.js",
"scripts": { "scripts": {
"test": "eslint server.js", "test": "eslint server.js",
"postinstall": "mkdir -p site/",
"start": "node server.js" "start": "node server.js"
}, },
"engines": {
"node": "5.11.1"
},
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git+https://github.com/RealOrangeOne/host-container.git" "url": "git+https://github.com/RealOrangeOne/host-container.git"
@ -18,7 +20,7 @@
}, },
"homepage": "https://github.com/RealOrangeOne/host-container#readme", "homepage": "https://github.com/RealOrangeOne/host-container#readme",
"dependencies": { "dependencies": {
"express": "=4.13.3" "express": "=4.14.0"
}, },
"devDependencies": { "devDependencies": {
"eslint": "=1.9.0", "eslint": "=1.9.0",

View File

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

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>