{"size": 956, "ext": "js", "max_stars_repo_path": "server.js", "max_stars_repo_name": "leonaysmael16/fitness-tracker", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "server.js", "max_issues_repo_name": "leonaysmael16/fitness-tracker", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "server.js", "max_forks_repo_name": "leonaysmael16/fitness-tracker", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 19.9166666667, "max_line_length": 62, "alphanum_fraction": 0.6548117155}
// dependencies

const express = require('express');
const logger = require("morgan");
const mongoose = require("mongoose");
const db = require("./models");
const dotenv = require('dotenv');
// const apiRoutes = require('../routes/apiroutes');
// const htmlRoutes = require('../routes/htmlroutes')



// PORT
const PORT = process.env.PORT || 3501;
const app = express();

app.use(logger("dev"));

app.use(express.urlencoded({ extended: true }));

app.use(express.json());

app.use(express.static("public"));
app.use(require("./routes/htmlroutes.js"));
app.use(require("./routes/apiroutes.js"));
// app.use("/",apiRoutes);
// app.use("/",htmlRoutes);




mongoose.connect(
    process.env.MONGODB_URI || 'mongodb://localhost/workouts',
    {
      useNewUrlParser: true,
      useUnifiedTopology: true,
      useCreateIndex: true,
      useFindAndModify: false
    }
  );





app.listen(PORT, () => {
    console.log(`Successfully running on ${PORT}`);
});