{"size": 983, "ext": "js", "max_stars_repo_path": "packages/nearportal-server/app/app.js", "max_stars_repo_name": "Brianspha/nearportal", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "packages/nearportal-server/app/app.js", "max_issues_repo_name": "Brianspha/nearportal", "max_issues_repo_issues_event_min_datetime": "2022-02-28T03:16:12.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-28T03:16:17.000Z", "max_forks_repo_path": "packages/nearportal-server/app/app.js", "max_forks_repo_name": "Brianspha/nearportal", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 2, "max_forks_count": null, "avg_line_length": 32.7666666667, "max_line_length": 110, "alphanum_fraction": 0.6703967447}
require("dotenv").config({});
const helpers = require('../helpers/')
const uuid = require('randomstring')
const log = console.log;
const port = process.env.PORT
const morgan = require('morgan')
const express = require('express')
const app = express();
const bodyParser = require('body-parser');
const net = require('net')
let http = require('http')
var server = http.createServer(app);

app.use(bodyParser.json())
app.use(morgan("combined"))
app.use(bodyParser.urlencoded({ // Middleware
    extended: true
}));

app.use(function (req, res, next) {
  res.header("Access-Control-Allow-Origin", "*"); // update to match the domain you will make the request from
  res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
  next();
});

app.post('/api/v1/upload/',helpers.addFile);
console.log(`nearportal-server running on port: ${port}`)
console.log("----------------------------------------------------");
server.listen(port)
module.exports= app;