2019-07-31 07:14:12 +00:00
|
|
|
require("dotenv").config();
|
|
|
|
const server = require("./api/server");
|
|
|
|
|
|
|
|
server.get("/", (req, res) => {
|
|
|
|
res.json({
|
2019-08-01 20:38:07 +00:00
|
|
|
message: `API server for Sleep Tracker up and running. :)`,
|
|
|
|
documentation: `https://github.com/ruihildt/sleep-tracker-backend#api-documentation`
|
2019-07-31 07:14:12 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2019-07-31 18:38:48 +00:00
|
|
|
const PORT = process.env.PORT || 4000;
|
2019-07-31 07:14:12 +00:00
|
|
|
|
|
|
|
server.listen(PORT, () => {
|
|
|
|
console.log(`Listening on port ${PORT}...`);
|
2019-07-31 18:38:48 +00:00
|
|
|
});
|