{"size": 840, "ext": "js", "max_stars_repo_path": "server.js", "max_stars_repo_name": "newmanix/express-test-1", "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": "newmanix/express-test-1", "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": "newmanix/express-test-1", "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.4545454545, "max_line_length": 87, "alphanum_fraction": 0.6726190476}
var express = require('express');
var data = require('./data/test.json');//our test data
var app = express();
const PORT = 3000;

app.use(express.static(__dirname + '/public')); // set location for static files
app.use(require("body-parser").urlencoded({extended: true})); // parse form submissions

/*

//allows access to the root for serving static files
app.use(express.static(__dirname));

//access asset files in public folder
app.use(express.static('public'));

//allows access to images folder
app.use('/images',express.static('images'));

*/

app.get('/',(req,res) =>{
  //res.send(`We're at the root of the app, on port ${PORT}`);
  //res.json(data);
  res.type('text/html');
  res.sendFile(__dirname + '/public/index.html');
});

app.listen(PORT, () =>{
  console.log(`App is listening on port ${PORT}`);
  console.log(data);
});
