Skip to content

Commit

Permalink
Added json parser
Browse files Browse the repository at this point in the history
  • Loading branch information
underdorff18 committed Oct 9, 2020
1 parent 6dea88b commit c362ddb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
4 changes: 3 additions & 1 deletion JS/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
const express = require('express' 4.17.1');
const express = require('express', '4.17.1');
const app = express();
const myparse = require('./parse');
const port = 3000;


console.log(JSON.stringify(myparse.systems));

app.get('/', (req, res) => {
res.send('Hello World!');
Expand Down
11 changes: 11 additions & 0 deletions JS/parse.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const fs = require('fs');
const path = require('path');

var systems;
fs.readFile('testinput.json', 'utf8', (err, data) => {
if (err) throw err;
console.log(data);
systems = JSON.parse(data);
});

exports.systems = systems;

0 comments on commit c362ddb

Please sign in to comment.