{"size": 723, "ext": "js", "max_stars_repo_path": "config/server.js", "max_stars_repo_name": "dustinsnoap/auto-backend-node", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "config/server.js", "max_issues_repo_name": "dustinsnoap/auto-backend-node", "max_issues_repo_issues_event_min_datetime": "2019-10-23T01:15:14.000Z", "max_issues_repo_issues_event_max_datetime": "2021-09-02T00:58:46.000Z", "max_forks_repo_path": "config/server.js", "max_forks_repo_name": "dustinsnoap/auto-backend-node", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 3, "max_forks_count": null, "avg_line_length": 26.7777777778, "max_line_length": 66, "alphanum_fraction": 0.6749654219}
//SETUP
const express = require("express")
const server = express()
const router = express.Router()

//IMPORT AND USE MIDDLEWARE
server.use(require('cors')())
server.use(require('helmet')())
server.use(express.json())  //json all the things!

//APP Middleware
//:add these the order you want to use them
const warez = [
    require('../middleware/customroutes'),
    require('../middleware/constraints'),
    require('../middleware/encrypt'),
    require('../middleware/prepare_req'),
    require('../middleware/make_req'),
    require('../middleware/prepare_res'),
]

//ALL ROUTES
server.use('/api/', router.all('*', [warez], async (req, res) => {
    res.status(req.status).json(req.response)
}))

module.exports = server