Skip to content

Commit

Permalink
Add server for deployment, move static files to public
Browse files Browse the repository at this point in the history
  • Loading branch information
viestat committed Mar 15, 2016
1 parent ea2377d commit c5096e7
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"description": "",
"main": "graph.js",
"scripts": {
"start": "node server.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Andres C. Viesca",
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions index.html → public/index.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="./node_modules/d3/d3.min.js"></script>
<link rel="stylesheet" type="text/css" href="./node_modules/bootstrap/dist/css/bootstrap.css">
<script type="text/javascript" src="/scripts/d3/d3.min.js"></script>
<link rel="stylesheet" type="text/css" href="/scripts/bootstrap/dist/css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="./stylesheet.css">
<script type="text/javascript" src="./graph.js"></script>
<title>Graphs</title>
Expand Down
File renamed without changes.
11 changes: 11 additions & 0 deletions server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
var express = require('express');
var app = express();

var port = process.env.PORT || 3000;

app.use(express.static(__dirname + '/public'));
app.use('/scripts', express.static('./node_modules/'));

app.listen(port, function () {
console.log('listening on port', port);
});

0 comments on commit c5096e7

Please sign in to comment.