Skip to content

Commit

Permalink
Merge pull request #27 from akhilome/ch-deploy-heroku-160239343
Browse files Browse the repository at this point in the history
#160239343 Host API on Heroku
  • Loading branch information
akhilome committed Sep 7, 2018
2 parents 57a5f1c + cc09a6c commit 3ee954d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules/
.nyc_output/
.coveralls.yml
.env
5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"homepage": "https://github.com/akhilome/fast-food-fast#readme",
"dependencies": {
"body-parser": "^1.18.3",
"dotenv": "^6.0.0",
"express": "^4.16.3"
},
"devDependencies": {
Expand Down
7 changes: 5 additions & 2 deletions server/index.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
import express from 'express';
import bodyParser from 'body-parser';
import dotenv from 'dotenv';
import router from './routes/routes';

dotenv.config();
const app = express();

app.get('/', (req, res) => {
res.status(200).json({
message: 'Welcome',
message: 'Welcome. API is live at /api/v1/',
});
});

app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));

app.use('/api/v1', router);

app.listen(3000);
app.listen(process.env.PORT);

export default app;

0 comments on commit 3ee954d

Please sign in to comment.