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
// 1. REQUIRE DEPENDENCIES | |
const express = require('express'); | |
const mongodb = require('mongodb'); | |
const cors = require('cors'); | |
const app = express(); | |
// enable the use of JSON | |
app.use(express.json()); |
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
-- Check if the database exists, if not, create it | |
CREATE DATABASE IF NOT EXISTS pet_hospital; | |
USE pet_hospital; | |
-- Create the `pets` table | |
CREATE TABLE IF NOT EXISTS pets ( | |
id INT AUTO_INCREMENT PRIMARY KEY, | |
name VARCHAR(255) NOT NULL, | |
species VARCHAR(255) NOT NULL, | |
breed VARCHAR(255) DEFAULT NULL, |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Book List</title> | |
<!-- include Bootstrap 5 CSS --> | |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css"> | |
</head> | |
<body> | |
<!-- A sample application that demonstrates the major features of ES6, ES7, ES8, ES9, and ES10 |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>ATM Machine</title> | |
<link rel="stylesheet" type="text/css" href="styles.css"> | |
</head> | |
<body> | |
<div class="atm"> | |
<div id="display">Insert card to begin</div> |
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
CREATE TABLE roles ( | |
role_id INT AUTO_INCREMENT PRIMARY KEY, | |
role_name VARCHAR(255) NOT NULL | |
); | |
CREATE TABLE users ( | |
user_id INT AUTO_INCREMENT PRIMARY KEY, | |
username VARCHAR(255) NOT NULL, | |
password VARCHAR(255) NOT NULL, | |
first_name VARCHAR(255) NOT NULL, |
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
const express = require('express'); | |
const ejs = require('ejs'); | |
const app = express(); | |
app.set('view engine', 'ejs'); | |
app.get('/', function(req,res){ | |
res.send("Hello World") | |
}) |
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
CREATE TABLE artists ( | |
id INT AUTO_INCREMENT PRIMARY KEY, | |
name VARCHAR(255) NOT NULL, | |
birth_year INT, | |
country VARCHAR(255) | |
) engine=innoDB; | |
ALTER TABLE `artists` ADD `preferred_medium` VARCHAR(255) NULL AFTER `country`; |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Fictional Business</title> | |
</head> | |
<body> | |
<header id="main-header"> | |
<h1>Fictional Business</h1> |
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
// 1. SETUP EXPRESS | |
const express = require('express'); | |
const hbs = require('hbs'); | |
const wax = require('wax-on'); | |
// 1a. create the app | |
const app = express(); | |
// 1b setup our view engine (aka template engine) | |
// tell Express that we are using hbs |
NewerOlder