Skip to content

Commit f2720e8

Browse files
committed
Move all to root for simplicity
1 parent cef4dd6 commit f2720e8

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

Procfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
web: node dist/index.js
1+
web: node index.js

dist/app.json renamed to app.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "Node API example",
33
"description": "A simple API built in Node and Express hosted on Heroku",
4-
"repository": "https://github.com/heroku/node-js-sample",
4+
"repository": "https://github.com/coryhouse/js-dev-env-demo-api",
55
"logo": "http://node-js-sample.herokuapp.com/node.svg",
66
"keywords": ["node", "express", "static"]
77
}

dist/index.js renamed to index.js

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
var express = require('express');
2-
var app = express();
1+
import express from 'express';
2+
3+
const app = express();
34

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

8+
app.get('/', function(request, response) {
9+
response.send('Hello World!')
10+
});
11+
712
app.get('/users', function(req, res) {
813
// Hard coding for simplicity. Pretend this hits a real database
914
res.json([
@@ -14,5 +19,5 @@ app.get('/users', function(req, res) {
1419
});
1520

1621
app.listen(app.get('port'), function() {
17-
console.log("Node app is running at localhost:" + app.get('port'));
22+
console.log("Node app is running at localhost:" + app.get('port'));
1823
});

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "A simple API built in Node and Express hosted on Heroku",
55
"main": "index.js",
66
"scripts": {
7-
"start": "node dist/index.js"
7+
"start": "node index.js"
88
},
99
"dependencies": {
1010
"express": "4.13.3"

0 commit comments

Comments
 (0)