-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
small refactor to fit specifications
- Loading branch information
1 parent
c362ddb
commit aa9d21c
Showing
5 changed files
with
30 additions
and
16 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const xlsx = require('xlsx'); | ||
|
||
const myfilepath = path.join(__dirname, 'Inventory', 'samplepc1234.xlsx'); | ||
|
||
function readInventoryFile(filepath) { | ||
const workbook = xlsx.readFileSync(filepath); | ||
const sheetNames = workbook.SheetNames; | ||
const data = workbook.Sheets[sheetNames[0]]; | ||
console.log(data); | ||
|
||
//Here is where we use known cell locations of the specs needed to build the systems file | ||
} | ||
|
||
|
||
readInventoryFile(myfilepath); | ||
//console.log('yo'); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,22 @@ | ||
const express = require('express', '4.17.1'); | ||
const fs = require('fs'); | ||
const app = express(); | ||
const myparse = require('./parse'); | ||
//const myparse = require('./parse'); | ||
const port = 3000; | ||
|
||
|
||
console.log(JSON.stringify(myparse.systems)); | ||
|
||
app.get('/', (req, res) => { | ||
res.send('Hello World!'); | ||
res.send('Homepage'); | ||
}); | ||
|
||
app.get('/systems.json', (req, res) => { | ||
fs.readFile('systems.json', 'utf8', (err, data) => { | ||
if (err) throw err; | ||
res.json(JSON.parse(data)); | ||
}); | ||
}); | ||
|
||
|
||
app.listen(port, () => { | ||
console.log('Listening at http://localhost:${port}'); | ||
console.log(`Listening at http://localhost:${port}`); | ||
}); |
This file was deleted.
Oops, something went wrong.
File renamed without changes.