Skip to content

Commit

Permalink
Move all to root for simplicity
Browse files Browse the repository at this point in the history
  • Loading branch information
coryhouse committed Oct 23, 2016
1 parent cef4dd6 commit f2720e8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
web: node dist/index.js
web: node index.js
2 changes: 1 addition & 1 deletion dist/app.json → app.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Node API example",
"description": "A simple API built in Node and Express hosted on Heroku",
"repository": "https://github.com/heroku/node-js-sample",
"repository": "https://github.com/coryhouse/js-dev-env-demo-api",
"logo": "http://node-js-sample.herokuapp.com/node.svg",
"keywords": ["node", "express", "static"]
}
11 changes: 8 additions & 3 deletions dist/index.js → index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
var express = require('express');
var app = express();
import express from 'express';

const app = express();

app.set('port', (process.env.PORT || 5000));
app.use(express.static(__dirname + '/public'));

app.get('/', function(request, response) {
response.send('Hello World!')
});

app.get('/users', function(req, res) {
// Hard coding for simplicity. Pretend this hits a real database
res.json([
Expand All @@ -14,5 +19,5 @@ app.get('/users', function(req, res) {
});

app.listen(app.get('port'), function() {
console.log("Node app is running at localhost:" + app.get('port'));
console.log("Node app is running at localhost:" + app.get('port'));
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "A simple API built in Node and Express hosted on Heroku",
"main": "index.js",
"scripts": {
"start": "node dist/index.js"
"start": "node index.js"
},
"dependencies": {
"express": "4.13.3"
Expand Down

0 comments on commit f2720e8

Please sign in to comment.