You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
497 B

5 years ago
  1. const express = require('express');
  2. const SQLite3Repository = require("./repositories/sqlite3");
  3. const repo = new SQLite3Repository("stuff.db");
  4. repo.setup().catch(err => {
  5. console.error("Failed to setup db:", err);
  6. process.exit(1);
  7. });
  8. const app = express();
  9. app.use(express.json({strict: false}));
  10. app.use("/api/bike/", require("./api/bike")(repo));
  11. app.use("/api/program/", require("./api/program")(repo));
  12. app.use("/api/workout/", require("./api/workout")(repo));
  13. app.listen(8780);