diff --git a/JS/index.js b/JS/index.js index 237b998..294cbcc 100644 --- a/JS/index.js +++ b/JS/index.js @@ -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!'); diff --git a/JS/parse.js b/JS/parse.js new file mode 100644 index 0000000..9b376c3 --- /dev/null +++ b/JS/parse.js @@ -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;