Skip to content
Snippets Groups Projects
Commit 7450cf33 authored by Aidan Holland's avatar Aidan Holland
Browse files

fix: Various fixes and compatabilties

parent 09929c7f
Branches
No related tags found
No related merge requests found
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Dependency directories
#node_modules/
# Optional npm cache directory
.npm
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# Database File
CLCBooks.db
Copyright 2019 trp74
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
function goToCCI() {
//window.open('https://drexel.edu/cci/');
window.open('https://drexel.edu/cci/');
}
......@@ -18,7 +18,7 @@ function getBooks() {
function myCallBack(xhr) {
if (xhr.readyState==4 && xhr.status==200) {
let table = document.getElementById('book-list');
table.innerHTML = `<tr>
table.innerHTML = `<tr id="header-row">
<th>Title</th>
<th>Author</th>
<th>ISBN</th>
......
logos/drexel.png

6.79 KiB | W: | H:

logos/drexel.png

17.7 KiB | W: | H:

logos/drexel.png
logos/drexel.png
logos/drexel.png
logos/drexel.png
  • 2-up
  • Swipe
  • Onion skin
{
"name": "ci101lab5",
"version": "0.0.1",
"description": "lab for ci 101",
"version": "0.0.2",
"description": "Lab for CI 101",
"license": "MIT",
"repository": {
"type": "git",
......@@ -11,5 +11,9 @@
"bootstrap": "^4.3.1",
"express": "^4.17.1",
"sqlite3": "^4.1.0"
},
"main": "server.js",
"scripts": {
"start": "node server.js"
}
}
const express = require("express");
const app = express();
const sqlite3 = require('sqlite3').verbose();
const sqlite3 = require("sqlite3").verbose();
app.use(express.static('.'));
app.use(express.static("."));
app.use(express.json());
app.get("/getBooks", function(req, res) {
const db = new sqlite3.Database('./CLCBooks.db');
console.log('recieved');
let output = '';
const db = new sqlite3.Database("./CLCBooks.db");
console.log("recieved");
let output = "";
db.serialize(function() {
db.each("SELECT Books.ISBN, Books.Title, Books.Author, Availability.Available FROM Books, Availability WHERE Books.ISBN = Availability.ISBN", function(err, row) {
db.each(
"SELECT Books.ISBN, Books.Title, Books.Author, Availability.Available FROM Books, Availability WHERE Books.ISBN = Availability.ISBN",
function(err, row) {
if (row) {
if (row.Available == 'Y') {
if (row.Available == "Y") {
row.Available = "Yes";
} else {
row.Available = "No";
}
output += `<tr> <td>` + row.Title + `</td><td>` + row.Author + `</td><td>` + row.ISBN + `</td> <td>` + row.Available + `</td></tr>`;
output += `<tr class="rows">
<td>${row.Title}</td>
<td>${row.Author}</td>
<td>${row.ISBN}</td>
<td>${row.Available}</td>
</tr>`;
}
});
}
);
});
setTimeout(function() {
db.close();
......@@ -28,6 +36,5 @@ app.get("/getBooks", function(req, res){
}, 500);
});
app.listen('8080', function(){
console.log("listening at port 8080...");
});
\ No newline at end of file
const port = "8080";
app.listen(port, () => console.log(`Listening at 127.0.0.1:${port}...`));
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment