Skip to content

Commit 698bc17

Browse files
committed
updates and fixes leading up to auto toc
1 parent 1842d27 commit 698bc17

File tree

28 files changed

+8543
-31
lines changed

28 files changed

+8543
-31
lines changed
Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
8+
# Runtime data
9+
pids
10+
*.pid
11+
*.seed
12+
*.pid.lock
13+
14+
# Directory for instrumented libs generated by jscoverage/JSCover
15+
lib-cov
16+
17+
# Coverage directory used by tools like istanbul
18+
coverage
19+
20+
# nyc test coverage
21+
.nyc_output
22+
23+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
24+
.grunt
25+
26+
# Bower dependency directory (https://bower.io/)
27+
bower_components
28+
29+
# node-waf configuration
30+
.lock-wscript
31+
32+
# Compiled binary addons (https://nodejs.org/api/addons.html)
33+
build/Release
34+
35+
# Dependency directories
36+
node_modules/
37+
jspm_packages/
38+
39+
# TypeScript v1 declaration files
40+
typings/
41+
42+
# Optional npm cache directory
43+
.npm
44+
45+
# Optional eslint cache
46+
.eslintcache
47+
48+
# Optional REPL history
49+
.node_repl_history
50+
51+
# Output of 'npm pack'
52+
*.tgz
53+
54+
# Yarn Integrity file
55+
.yarn-integrity
56+
57+
# dotenv environment variables file
58+
.env
59+
.env.test
60+
61+
# parcel-bundler cache (https://parceljs.org/)
62+
.cache
63+
64+
# next.js build output
65+
.next
66+
67+
# nuxt.js build output
68+
.nuxt
69+
70+
# vuepress build output
71+
.vuepress/dist
72+
73+
# Serverless directories
74+
.serverless/
75+
76+
# FuseBox cache
77+
.fusebox/
78+
79+
# DynamoDB Local files
80+
.dynamodb/
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
License
2+
3+
Copyright (c) 2019 Lambda, Inc.
4+
5+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
6+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
7+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
8+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
9+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
10+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
11+
SOFTWARE.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Node API 3 Guided Project
2+
3+
Guided project for **Node API** module 3.
4+
5+
In this project we will learn how to create a very simple Web API using `Node.js` and `Express`, and learn to use and create `Express Middleware`.
6+
7+
## Prerequisites
8+
9+
- A REST client like [Insomnia](https://insomnia.rest/download/) or [Postman](https://www.getpostman.com/downloads/) installed.
10+
11+
## Project Setup
12+
13+
- [ ] import this repository into your account.
14+
- [ ] clone your version of the repository.
15+
- [ ] **CD into the folder** where you cloned the repository.
16+
- [ ] type `npm i` to download dependencies.
17+
18+
Please follow along as the instructor creates and adds `middleware` to the API step by step.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const knex = require('knex');
2+
3+
const config = require('../knexfile.js');
4+
5+
module.exports = knex(config.development);
Binary file not shown.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
exports.up = function(knex) {
2+
return knex.schema
3+
.createTable('hubs', tbl => {
4+
tbl.increments();
5+
tbl.string('name').notNullable();
6+
tbl.timestamps(true, true);
7+
8+
tbl.unique('name');
9+
})
10+
.createTable('messages', tbl => {
11+
tbl.increments();
12+
tbl
13+
.string('sender')
14+
.notNullable()
15+
.index();
16+
tbl.text('text').notNullable();
17+
tbl.timestamps(true, true);
18+
19+
tbl
20+
.integer('hub_id')
21+
.unsigned()
22+
.notNullable()
23+
.references('id')
24+
.inTable('hubs')
25+
.onDelete('CASCADE')
26+
.onUpdate('CASCADE');
27+
});
28+
};
29+
30+
exports.down = function(knex) {
31+
return knex.schema.dropTableIfExists('messages').dropTableIfExists('hubs');
32+
};

0 commit comments

Comments
 (0)