Browse Source

configuració per heroku

master
nau 7 years ago
parent
commit
82868e8ae8
3 changed files with 6 additions and 2 deletions
  1. +2
    -1
      config.js
  2. +3
    -0
      package.json
  3. +1
    -1
      server.js

+ 2
- 1
config.js

@ -1,6 +1,7 @@
module.exports = {
'secret': 'secretfortoken',
'database': 'mongodb://userdb:userdb@ds013366.mlab.com:13366/thoughts'
'database': 'mongodb://userdb:userdb@ds013366.mlab.com:13366/thoughts',
"port" : process.env.PORT || 3000
};

+ 3
- 0
package.json

@ -3,6 +3,9 @@
"version": "0.0.1",
"description": "micro blogging server and client",
"main": "server.js",
"scripts": {
"start": "node server.js"
},
"dependencies": {
"mongoose": "^4.5.6",
"express": "^4.7.1",

+ 1
- 1
server.js

@ -118,6 +118,6 @@ app.use('/api', apiRoutes);
// end of API routes -------------------------------------
// Start server
app.listen(3000, function() {
app.listen(config.port, function() {
console.log("Node server running on http://localhost:3000");
});

Loading…
Cancel
Save