Skip to content

Instantly share code, notes, and snippets.

const express = require('express');
const app = express();
const port = 3000;
const connection = require('./db');
const bodyParser = require('body-parser');
// Support JSON-encoded bodies
app.use(bodyParser.json());
// Support URL-encoded bodies
app.use(bodyParser.urlencoded({
extended: true
const express = require('express');
const app = express();
const port = 3000;
const connection = require('./db');
const bodyParser = require('body-parser');
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({
extended: true
const express = require('express');
const app = express();
const port = 3000;
const connection = require('./db');
const bodyParser = require('body-parser');
// Support JSON-encoded bodies
app.use(bodyParser.json());
// Support URL-encoded bodies
app.use(bodyParser.urlencoded({
extended: true
const express = require('express');
const app = express();
const port = 3000;
const connection = require('./db');
app.get('/api/movies', (request, response) => {
connection.query('SELECT * FROM movie', (error, result) => {
if (error) {
throw error;
}
const express = require('express');
const app = express();
const port = 3000;
app.get('/api/movies', (request, response) => {
response.send('All Films');
});
app.get('/api/movies/:id', (request, response) => {
response.json({id: request.params.id});
1.) “Durmstrang Institute” is actually in Sweden (Sweden), so modify its country.
mysql> UPDATE school SET country='Sweden' WHERE name='Durmstrang Institute';
Query OK, 1 row affected (0.05 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> SELECT * FROM school
-> SELECT * FROM school;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT * FROM school' at line 2
mysql> SELECT * FROM school;
process.stdin.resume()
process.stdin.setEncoding('utf8')
const currentYear = new Date().getFullYear();
const birthYear = (age) => {
if (age.isNaN || age > 99) {
} else{
let numYears = currentYear - age;
if (numYears < currentYear) {
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>The HTML5 Herald</title>
<meta name="description" content="The HTML5 Herald">
<meta name="author" content="SitePoint">
126 cd Downloads/
127 ls
128 ls clmystery-master.zip
129 ll clmystery-master.zip
130 ls clmystery-master.zip
131 ls .hidden clmystery-master.zip
132 unzip clmystery-master.zip
133 grep "67Monument Avenue, line 248" clmystery-master/mystery/interviews/
134 ls
135 cd clmystery-master/