{"size": 558, "ext": "js", "max_stars_repo_path": "server.js", "max_stars_repo_name": "lindsayreiner/e-commerce-backend", "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": "lindsayreiner/e-commerce-backend", "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": "lindsayreiner/e-commerce-backend", "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": 25.3636363636, "max_line_length": 86, "alphanum_fraction": 0.6541218638}
require('dotenv').config();
const express = require('express');
const routes = require('./routes');
const connection = require('./config/connection')


const force = JSON.parse(process.env.DB_FORCE_SYNC);//if not working, change to object

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

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

app.use(routes);

connection.sync({ force }).then(() => {
    app.listen(PORT, () => {
        console.log(`App listening on port ${PORT}!`);
    });
    console.log('synced!');
})