{"size": 620, "ext": "js", "max_stars_repo_path": "app.js", "max_stars_repo_name": "RickyLovesCode/Express-Note-Taker", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "app.js", "max_issues_repo_name": "RickyLovesCode/Express-Note-Taker", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "app.js", "max_forks_repo_name": "RickyLovesCode/Express-Note-Taker", "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": 29.5238095238, "max_line_length": 62, "alphanum_fraction": 0.6967741935}
const express = require("express");
const app = express();
const PORT = process.env.PORT || 3001;

const notesApiRoutes = require("./routes/apiRoutes/notesApi");
const indexRoutes = require("./routes/htmlRoutes/index");
const notesRoutes = require("./routes/htmlRoutes/notes");

// parse incoming string or array data
app.use(express.urlencoded({ extended: true }));
// parse incoming JSON data
app.use(express.json());
app.use(express.static("public"));

app.use("/api", notesApiRoutes);
app.use("/", notesRoutes);
app.use("/", indexRoutes);

app.listen(PORT, () => {
    console.log(`Server now live on ${PORT}!`);
});