Help with SQL commands to interact with a MySQL database
- Mac /usr/local/mysql/bin
- Windows /Program Files/MySQL/MySQL version/bin
- Xampp /xampp/mysql/bin
| // Sending an HTTP Request from a NodeJS server | |
| //const http = require("http"); | |
| const https = require("https"); | |
| const Stream = require("stream").Transform; | |
| const fs = require("fs"); | |
| https | |
| .get("https://api.nasa.gov/planetary/apod?api_key=DEMO_KEY", resp => { |
| // A BASIC Node server | |
| // Routing Requests | |
| const http = require("http"); | |
| const url = require("url"); | |
| const server = http.createServer(function(req, res) { | |
| //console.log(req.url); | |
| let parsedURL = url.parse(req.url, true); | |
| let path = parsedURL.pathname; |
| // A BASIC Node server | |
| const http = require("http"); | |
| const server = http.createServer(function(req, res) { | |
| res.setHeader("Content-type", "application/json"); | |
| res.setHeader("Access-Control-Allow-Origin", "*"); | |
| res.writeHead(200); //status code HTTP 200 / OK | |
| let dataObj = { id: 123, name: "Bob", email: "bob@work.org" }; |
| "use strict"; | |
| const express = require("express"); | |
| const app = express(); | |
| const port = process.env.port || 5005; | |
| // https://expressjs.com/en/4x/api.html#express.static | |
| let options = { | |
| dotfiles: "ignore", //allow, deny, ignore | |
| etag: true, | |
| extensions: ["htm", "html"], |
| "use strict"; | |
| const data = require("./data"); //data.channels[n].id .name .last_update | |
| const express = require("express"); | |
| const app = express(); | |
| app.use(express.json()); | |
| app.get("/api/channel", (req, res) => { | |
| //return the list of channels | |
| // respond with a 200 |
| /* | |
| ********************************************************************* | |
| http://www.mysqltutorial.org | |
| ********************************************************************* | |
| Name: MySQL Sample Database classicmodels | |
| Link: http://www.mysqltutorial.org/mysql-sample-database.aspx | |
| Version 3.2 | |
| + changed the order of the CREATE TABLE and ALTER TABLE commands to work with MySQL 5.7 | |
| and issues with FOREIGN KEY CONSTRAINTS | |
| Version 3.1 |
| -- phpMyAdmin SQL Dump | |
| -- version 4.8.5 | |
| -- https://www.phpmyadmin.net/ | |
| -- | |
| -- Host: localhost:8889 | |
| -- Generation Time: May 26, 2019 at 07:52 PM | |
| -- Server version: 5.7.25 | |
| -- PHP Version: 7.3.1 | |
| SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; |
| -- phpMyAdmin SQL Dump | |
| -- version 4.8.5 | |
| -- https://www.phpmyadmin.net/ | |
| -- | |
| -- Host: localhost:8889 | |
| -- Generation Time: May 18, 2019 at 01:20 PM | |
| -- Server version: 5.7.25 | |
| -- PHP Version: 7.3.1 | |
| SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; |