Skip to content

Commit

Permalink
bg(fix application errors): Fix errors
Browse files Browse the repository at this point in the history
- Fix start script for production
- Add route that checks for a non-existing route

[Finishes #169776372]
  • Loading branch information
nziokaivy committed Dec 9, 2019
1 parent 19076a8 commit 98d7295
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
web:npm start
web: npm run dev-start
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"description": "A Social platform for the creative at heart",
"main": "index.js",
"scripts": {
"start": "./src/index.js --exec babel-node --",
"build": "babel src -d dist ",
"start": "npm build && node /app/build/index.js",
"myBuild": "babel -d build/ src",
"eslint": "eslint --ignore-path .gitignore .",
"db-seed": "NODE_ENV=testing npx sequelize-cli db:seed:undo:all && NODE_ENV=testing sequelize db:seed:all",
"db-seed-dev": "npx sequelize-cli db:seed:undo:all && sequelize db:seed:all",
Expand Down
4 changes: 4 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@ app.use(cors());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.text());
app.use(bodyParser.json({ type: 'application/json' }));

app.use('/', router);

app.get('/', (req, res) => res.status(200).send({
message: 'Welcome to Barefoot Nomad.'
}));
app.use('*', (req, res) => res.status(404).send({
message: 'Ooops route does not exist!'
}));

app.use('/static', express.static(path.join(__dirname, 'public')));

Expand Down

0 comments on commit 98d7295

Please sign in to comment.