0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 18:32:41 +00:00
Files
homebrewery/server.js
Trevor Buckner d7aa4afa60 process.chdir in app.js.
Everything works, no need for path.resolve. All tests pass.
2022-01-29 23:53:30 -05:00

13 lines
397 B
JavaScript

const DB = require('./server/db.js');
const server = require('./server/app.js');
const config = require('./server/config.js');
DB.connect(config).then(()=>{
// Ensure that we have successfully connected to the database
// before launching server
const PORT = process.env.PORT || config.get('web_port') || 8000;
server.app.listen(PORT, ()=>{
console.log(`server on port: ${PORT}`);
});
});