{"size": 712, "ext": "js", "max_stars_repo_path": "server/index.js", "max_stars_repo_name": "atamyratabdy/youtube-video-scraper", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "server/index.js", "max_issues_repo_name": "atamyratabdy/youtube-video-scraper", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "server/index.js", "max_forks_repo_name": "atamyratabdy/youtube-video-scraper", "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.7777777778, "max_line_length": 51, "alphanum_fraction": 0.6938202247}
/* eslint-disable no-console */
const express = require('express')
const cors = require('cors')
const bodyParser = require('body-parser')
const compression = require('compression')
const helmet = require('helmet')

const route = require('../route')

const app = express()

// CORS config
app.use(
  cors({
    origin: '*',
    optionsSuccessStatus: 200,
    methods: ['GET'],
    allowedHeaders: ['Content-Type']
  })
)

// security headers middleware
app.use(helmet())

// request body parser middleware
app.use(bodyParser.json())
app.use(bodyParser.urlencoded({ extended: false }))

// compacting requests using GZIP middleware
app.use(compression())

// import Route
app.use('/', route)

module.exports = app
