├── .dockerignore ├── .gitignore ├── README.md ├── client ├── .browserslistrc ├── .editorconfig ├── .gitignore ├── Dockerfile ├── README.md ├── angular.json ├── e2e │ ├── protractor.conf.js │ ├── src │ │ ├── app.e2e-spec.ts │ │ └── app.po.ts │ └── tsconfig.json ├── karma.conf.js ├── package-lock.json ├── package.json ├── server.js ├── src │ ├── app │ │ ├── app-routing.module.ts │ │ ├── app.component.html │ │ ├── app.component.scss │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── components │ │ │ ├── add-book │ │ │ │ ├── add-book.component.html │ │ │ │ ├── add-book.component.scss │ │ │ │ └── add-book.component.ts │ │ │ ├── book-detail │ │ │ │ ├── book-detail.component.html │ │ │ │ ├── book-detail.component.scss │ │ │ │ └── book-detail.component.ts │ │ │ └── books-list │ │ │ │ ├── books-list.component.html │ │ │ │ ├── books-list.component.scss │ │ │ │ └── books-list.component.ts │ │ ├── models │ │ │ └── Book.ts │ │ └── services │ │ │ └── crud.service.ts │ ├── assets │ │ └── .gitkeep │ ├── environments │ │ ├── environment.prod.ts │ │ └── environment.ts │ ├── favicon.ico │ ├── index.html │ ├── main.ts │ ├── polyfills.ts │ ├── styles.scss │ └── test.ts ├── tsconfig.app.json ├── tsconfig.json ├── tsconfig.spec.json └── tslint.json ├── docker-compose.yaml └── server ├── .dockerignore ├── .gitignore ├── Dockerfile ├── app.js ├── controllers └── book.js ├── models └── Book.js ├── package-lock.json ├── package.json └── routes └── book.js /.dockerignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | node_modules 3 | npm-debug.log 4 | Dockerfile* 5 | docker-compose* 6 | .dockerignore 7 | .git 8 | .gitignore 9 | README.md 10 | LICENSE 11 | .vscode -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | .gitlab-ci-example.txt 3 | 4 | # dependencies 5 | /node_modules 6 | /.pnp 7 | .pnp.js 8 | 9 | # testing 10 | /coverage 11 | 12 | # production 13 | /build 14 | 15 | # misc 16 | .DS_Store 17 | .env.local 18 | .env.development.local 19 | .env.test.local 20 | .env.production.local 21 | 22 | npm-debug.log* 23 | yarn-debug.log* 24 | yarn-error.log* 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | by [Dylut2000](https://twitter.com/dylut2000?lang=en) 2 | # 3 | 4 | # Angular 11 + Node-JS + MongoDB Crud app 5 | 6 | This app will introduce all entry level interns to learn the basic concept of : 7 | 8 | - Angular 9 | - Node JS (express) && Mongo DB 10 | - Docker && Docker-compose 11 | 12 | Feel free to use this as a template to your project. 13 | 14 | to run the project: 15 | 16 | ## option 1: 17 | 18 | 1. start your mongoDB 19 | 2. open your server directory in a terminal 20 | 3. enter the following commands 21 | 22 | ``` 23 | npm install 24 | npm start 25 | ``` 26 | 1. open your client directory in a terminal 27 | 3. enter the following commands 28 | ``` 29 | npm install 30 | ng serve -o 31 | ``` 32 | 33 | ## option 2: 34 | 1. install docker && docker-compose in your system 35 | 2. open your project root directory then use the following command 36 | 37 | ``` 38 | docker-compose up --build 39 | ``` 40 | the process will take long in order to get the app up 41 | 42 | 3. then go to http://localhost:4200 43 | 44 | # 45 | 46 | -------------------------------------------------------------------------------- /client/.browserslistrc: -------------------------------------------------------------------------------- 1 | # This file is used by the build system to adjust CSS and JS output to support the specified browsers below. 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | 5 | # For the full list of supported browsers by the Angular framework, please see: 6 | # https://angular.io/guide/browser-support 7 | 8 | # You can see what browsers were selected by your queries by running: 9 | # npx browserslist 10 | 11 | last 1 Chrome version 12 | last 1 Firefox version 13 | last 2 Edge major versions 14 | last 2 Safari major versions 15 | last 2 iOS major versions 16 | Firefox ESR 17 | not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line. 18 | -------------------------------------------------------------------------------- /client/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.ts] 12 | quote_type = single 13 | 14 | [*.md] 15 | max_line_length = off 16 | trim_trailing_whitespace = false 17 | -------------------------------------------------------------------------------- /client/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | # Only exists if Bazel was run 8 | /bazel-out 9 | 10 | # dependencies 11 | /node_modules 12 | 13 | # profiling files 14 | chrome-profiler-events*.json 15 | speed-measure-plugin*.json 16 | 17 | # IDEs and editors 18 | /.idea 19 | .project 20 | .classpath 21 | .c9/ 22 | *.launch 23 | .settings/ 24 | *.sublime-workspace 25 | 26 | # IDE - VSCode 27 | .vscode/* 28 | !.vscode/settings.json 29 | !.vscode/tasks.json 30 | !.vscode/launch.json 31 | !.vscode/extensions.json 32 | .history/* 33 | 34 | # misc 35 | /.sass-cache 36 | /connect.lock 37 | /coverage 38 | /libpeerconnection.log 39 | npm-debug.log 40 | yarn-error.log 41 | testem.log 42 | /typings 43 | 44 | # System Files 45 | .DS_Store 46 | Thumbs.db 47 | -------------------------------------------------------------------------------- /client/Dockerfile: -------------------------------------------------------------------------------- 1 | # Create image based on the official Node image from dockerhub 2 | FROM node:14.15.0-alpine3.10 3 | # Create a directory where our app will be placed 4 | RUN mkdir -p /usr/src/app 5 | # Change directory so that our commands run inside this new directory 6 | WORKDIR /usr/src/app 7 | # Copy dependency definitions 8 | COPY package.json /usr/src/app 9 | # Install dependecies 10 | RUN npm install 11 | # Get all the code needed to run the app 12 | COPY . /usr/src/app 13 | # build angular project 14 | RUN npm run build --prod 15 | # remove node_module 16 | RUN rm -rf node_modules 17 | RUN npm i express 18 | # Expose the port the app runs in 19 | EXPOSE 4200 20 | # Serve the app 21 | CMD ["node", "server.js"] 22 | -------------------------------------------------------------------------------- /client/README.md: -------------------------------------------------------------------------------- 1 | # Client 2 | 3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 11.2.1. 4 | 5 | ## Development server 6 | 7 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. 8 | 9 | ## Code scaffolding 10 | 11 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. 12 | 13 | ## Build 14 | 15 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build. 16 | 17 | ## Running unit tests 18 | 19 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). 20 | 21 | ## Running end-to-end tests 22 | 23 | Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). 24 | 25 | ## Further help 26 | 27 | To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page. 28 | -------------------------------------------------------------------------------- /client/angular.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "cli": { 4 | "analytics": "6dc1d132-f987-4dc2-a23a-ba8efdcc064e" 5 | }, 6 | "version": 1, 7 | "newProjectRoot": "projects", 8 | "projects": { 9 | "client": { 10 | "projectType": "application", 11 | "schematics": { 12 | "@schematics/angular:component": { 13 | "style": "scss" 14 | } 15 | }, 16 | "root": "", 17 | "sourceRoot": "src", 18 | "prefix": "app", 19 | "architect": { 20 | "build": { 21 | "builder": "@angular-devkit/build-angular:browser", 22 | "options": { 23 | "outputPath": "dist/client", 24 | "index": "src/index.html", 25 | "main": "src/main.ts", 26 | "polyfills": "src/polyfills.ts", 27 | "tsConfig": "tsconfig.app.json", 28 | "aot": true, 29 | "assets": [ 30 | "src/favicon.ico", 31 | "src/assets" 32 | ], 33 | "styles": [ 34 | "src/styles.scss", 35 | "node_modules/bootstrap/dist/css/bootstrap.min.css" 36 | ], 37 | "scripts": [] 38 | }, 39 | "configurations": { 40 | "production": { 41 | "fileReplacements": [ 42 | { 43 | "replace": "src/environments/environment.ts", 44 | "with": "src/environments/environment.prod.ts" 45 | } 46 | ], 47 | "optimization": true, 48 | "outputHashing": "all", 49 | "sourceMap": false, 50 | "namedChunks": false, 51 | "extractLicenses": true, 52 | "vendorChunk": false, 53 | "buildOptimizer": true, 54 | "budgets": [ 55 | { 56 | "type": "initial", 57 | "maximumWarning": "2mb", 58 | "maximumError": "5mb" 59 | }, 60 | { 61 | "type": "anyComponentStyle", 62 | "maximumWarning": "6kb", 63 | "maximumError": "10kb" 64 | } 65 | ] 66 | } 67 | } 68 | }, 69 | "serve": { 70 | "builder": "@angular-devkit/build-angular:dev-server", 71 | "options": { 72 | "browserTarget": "client:build" 73 | }, 74 | "configurations": { 75 | "production": { 76 | "browserTarget": "client:build:production" 77 | } 78 | } 79 | }, 80 | "extract-i18n": { 81 | "builder": "@angular-devkit/build-angular:extract-i18n", 82 | "options": { 83 | "browserTarget": "client:build" 84 | } 85 | }, 86 | "test": { 87 | "builder": "@angular-devkit/build-angular:karma", 88 | "options": { 89 | "main": "src/test.ts", 90 | "polyfills": "src/polyfills.ts", 91 | "tsConfig": "tsconfig.spec.json", 92 | "karmaConfig": "karma.conf.js", 93 | "assets": [ 94 | "src/favicon.ico", 95 | "src/assets" 96 | ], 97 | "styles": [ 98 | "src/styles.scss" 99 | ], 100 | "scripts": [] 101 | } 102 | }, 103 | "lint": { 104 | "builder": "@angular-devkit/build-angular:tslint", 105 | "options": { 106 | "tsConfig": [ 107 | "tsconfig.app.json", 108 | "tsconfig.spec.json", 109 | "e2e/tsconfig.json" 110 | ], 111 | "exclude": [ 112 | "**/node_modules/**" 113 | ] 114 | } 115 | }, 116 | "e2e": { 117 | "builder": "@angular-devkit/build-angular:protractor", 118 | "options": { 119 | "protractorConfig": "e2e/protractor.conf.js", 120 | "devServerTarget": "client:serve" 121 | }, 122 | "configurations": { 123 | "production": { 124 | "devServerTarget": "client:serve:production" 125 | } 126 | } 127 | } 128 | } 129 | } 130 | }, 131 | "defaultProject": "client" 132 | } 133 | -------------------------------------------------------------------------------- /client/e2e/protractor.conf.js: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | // Protractor configuration file, see link for more information 3 | // https://github.com/angular/protractor/blob/master/lib/config.ts 4 | 5 | const { SpecReporter, StacktraceOption } = require('jasmine-spec-reporter'); 6 | 7 | /** 8 | * @type { import("protractor").Config } 9 | */ 10 | exports.config = { 11 | allScriptsTimeout: 11000, 12 | specs: [ 13 | './src/**/*.e2e-spec.ts' 14 | ], 15 | capabilities: { 16 | browserName: 'chrome' 17 | }, 18 | directConnect: true, 19 | SELENIUM_PROMISE_MANAGER: false, 20 | baseUrl: 'http://localhost:4200/', 21 | framework: 'jasmine', 22 | jasmineNodeOpts: { 23 | showColors: true, 24 | defaultTimeoutInterval: 30000, 25 | print: function() {} 26 | }, 27 | onPrepare() { 28 | require('ts-node').register({ 29 | project: require('path').join(__dirname, './tsconfig.json') 30 | }); 31 | jasmine.getEnv().addReporter(new SpecReporter({ 32 | spec: { 33 | displayStacktrace: StacktraceOption.PRETTY 34 | } 35 | })); 36 | } 37 | }; -------------------------------------------------------------------------------- /client/e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { browser, logging } from 'protractor'; 2 | import { AppPage } from './app.po'; 3 | 4 | describe('workspace-project App', () => { 5 | let page: AppPage; 6 | 7 | beforeEach(() => { 8 | page = new AppPage(); 9 | }); 10 | 11 | it('should display welcome message', async () => { 12 | await page.navigateTo(); 13 | expect(await page.getTitleText()).toEqual('client app is running!'); 14 | }); 15 | 16 | afterEach(async () => { 17 | // Assert that there are no errors emitted from the browser 18 | const logs = await browser.manage().logs().get(logging.Type.BROWSER); 19 | expect(logs).not.toContain(jasmine.objectContaining({ 20 | level: logging.Level.SEVERE, 21 | } as logging.Entry)); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /client/e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | async navigateTo(): Promise { 5 | return browser.get(browser.baseUrl); 6 | } 7 | 8 | async getTitleText(): Promise { 9 | return element(by.css('app-root .content span')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /client/e2e/tsconfig.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "../tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "../out-tsc/e2e", 6 | "module": "commonjs", 7 | "target": "es2018", 8 | "types": [ 9 | "jasmine", 10 | "node" 11 | ] 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /client/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular-devkit/build-angular'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage'), 13 | require('@angular-devkit/build-angular/plugins/karma') 14 | ], 15 | client: { 16 | jasmine: { 17 | // you can add configuration options for Jasmine here 18 | // the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html 19 | // for example, you can disable the random execution with `random: false` 20 | // or set a specific seed with `seed: 4321` 21 | }, 22 | clearContext: false // leave Jasmine Spec Runner output visible in browser 23 | }, 24 | jasmineHtmlReporter: { 25 | suppressAll: true // removes the duplicated traces 26 | }, 27 | coverageReporter: { 28 | dir: require('path').join(__dirname, './coverage/client'), 29 | subdir: '.', 30 | reporters: [ 31 | { type: 'html' }, 32 | { type: 'text-summary' } 33 | ] 34 | }, 35 | reporters: ['progress', 'kjhtml'], 36 | port: 9876, 37 | colors: true, 38 | logLevel: config.LOG_INFO, 39 | autoWatch: true, 40 | browsers: ['Chrome'], 41 | singleRun: false, 42 | restartOnFileChange: true 43 | }); 44 | }; 45 | -------------------------------------------------------------------------------- /client/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "client", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "ng": "ng", 6 | "start": "ng serve", 7 | "build": "ng build", 8 | "test": "ng test", 9 | "lint": "ng lint", 10 | "e2e": "ng e2e" 11 | }, 12 | "private": true, 13 | "dependencies": { 14 | "@angular/animations": "~11.2.1", 15 | "@angular/common": "~11.2.1", 16 | "@angular/compiler": "~11.2.1", 17 | "@angular/core": "~11.2.1", 18 | "@angular/forms": "~11.2.1", 19 | "@angular/platform-browser": "~11.2.1", 20 | "@angular/platform-browser-dynamic": "~11.2.1", 21 | "@angular/router": "~11.2.1", 22 | "bootstrap": "^4.6.0", 23 | "rxjs": "~6.6.0", 24 | "tslib": "^2.0.0", 25 | "zone.js": "~0.11.3" 26 | }, 27 | "devDependencies": { 28 | "@angular-devkit/build-angular": "~0.1102.1", 29 | "@angular/cli": "~11.2.1", 30 | "@angular/compiler-cli": "~11.2.1", 31 | "@types/jasmine": "~3.6.0", 32 | "@types/node": "^12.11.1", 33 | "codelyzer": "^6.0.0", 34 | "jasmine-core": "~3.6.0", 35 | "jasmine-spec-reporter": "~5.0.0", 36 | "karma": "~6.1.0", 37 | "karma-chrome-launcher": "~3.1.0", 38 | "karma-coverage": "~2.0.3", 39 | "karma-jasmine": "~4.0.0", 40 | "karma-jasmine-html-reporter": "^1.5.0", 41 | "protractor": "~7.0.0", 42 | "ts-node": "~8.3.0", 43 | "tslint": "~6.1.0", 44 | "typescript": "~4.1.2" 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /client/server.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const http = require('http'); 3 | 4 | const app = express(); 5 | const port = process.env.PORT || 4200; 6 | 7 | app.use('/', express.static(__dirname + '/dist/client')); 8 | 9 | const server = http.createServer(app); 10 | 11 | server.listen(port, ()=> console.log(`>>>> server running in port ${port}`)); 12 | -------------------------------------------------------------------------------- /client/src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { RouterModule, Routes } from '@angular/router'; 3 | import { AddBookComponent } from './components/add-book/add-book.component'; 4 | import { BookDetailComponent } from './components/book-detail/book-detail.component'; 5 | import { BooksListComponent } from './components/books-list/books-list.component'; 6 | 7 | const routes: Routes = [ 8 | { path: '', pathMatch: 'full', redirectTo: 'books-list' }, 9 | { path: 'books-list', component: BooksListComponent }, 10 | { path: 'add-book', component: AddBookComponent }, 11 | { path: 'edit-book/:id', component: BookDetailComponent } 12 | ]; 13 | 14 | @NgModule({ 15 | imports: [RouterModule.forRoot(routes)], 16 | exports: [RouterModule] 17 | }) 18 | export class AppRoutingModule { } 19 | -------------------------------------------------------------------------------- /client/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 14 | 15 |
16 | 17 |
18 | -------------------------------------------------------------------------------- /client/src/app/app.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylut2000/Angular11-CRUD-with-NodeJS/a0d4490b1e32d25fdf5719eb94c7c9f2325f02df/client/src/app/app.component.scss -------------------------------------------------------------------------------- /client/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.scss'] 7 | }) 8 | export class AppComponent { 9 | title = 'client'; 10 | } 11 | -------------------------------------------------------------------------------- /client/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { BrowserModule } from '@angular/platform-browser'; 3 | import { FormsModule, ReactiveFormsModule } from '@angular/forms'; 4 | import { HttpClientModule } from '@angular/common/http'; 5 | 6 | import { AppRoutingModule } from './app-routing.module'; 7 | import { AppComponent } from './app.component'; 8 | import { AddBookComponent } from './components/add-book/add-book.component'; 9 | import { BookDetailComponent } from './components/book-detail/book-detail.component'; 10 | import { BooksListComponent } from './components/books-list/books-list.component'; 11 | 12 | @NgModule({ 13 | declarations: [ 14 | AppComponent, 15 | AddBookComponent, 16 | BookDetailComponent, 17 | BooksListComponent 18 | ], 19 | imports: [ 20 | BrowserModule, 21 | AppRoutingModule, 22 | FormsModule, 23 | HttpClientModule, 24 | ReactiveFormsModule 25 | ], 26 | providers: [], 27 | bootstrap: [AppComponent] 28 | }) 29 | export class AppModule { } 30 | -------------------------------------------------------------------------------- /client/src/app/components/add-book/add-book.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 | 6 | 7 |
8 | 9 |
10 | 11 | 12 |
13 | 14 |
15 | 16 | 17 |
18 | 19 |
20 | 21 |
22 |
23 |
24 |
25 | -------------------------------------------------------------------------------- /client/src/app/components/add-book/add-book.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylut2000/Angular11-CRUD-with-NodeJS/a0d4490b1e32d25fdf5719eb94c7c9f2325f02df/client/src/app/components/add-book/add-book.component.scss -------------------------------------------------------------------------------- /client/src/app/components/add-book/add-book.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, NgZone, OnInit } from '@angular/core'; 2 | import { Router } from '@angular/router'; 3 | import { CrudService } from '../../services/crud.service'; 4 | import { FormGroup, FormBuilder } from "@angular/forms"; 5 | 6 | @Component({ 7 | selector: 'app-add-book', 8 | templateUrl: './add-book.component.html', 9 | styleUrls: [ './add-book.component.scss' ] 10 | }) 11 | export class AddBookComponent implements OnInit { 12 | 13 | bookForm: FormGroup; 14 | 15 | constructor (public formBuilder: FormBuilder, 16 | private router: Router, 17 | private ngZone: NgZone, 18 | private crudService: CrudService) { 19 | this.bookForm = this.formBuilder.group({ 20 | name: [ '' ], 21 | price: [ ], 22 | description: [ '' ] 23 | }); 24 | } 25 | 26 | ngOnInit (): void { 27 | } 28 | 29 | 30 | onSubmit(): any { 31 | this.crudService.AddBook(this.bookForm.value) 32 | .subscribe(() => { 33 | console.log('Data added successfully!') 34 | this.ngZone.run(() => this.router.navigateByUrl('/books-list')) 35 | }, (err) => { 36 | console.log(err); 37 | }); 38 | } 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /client/src/app/components/book-detail/book-detail.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 | 6 | 7 |
8 | 9 |
10 | 11 | 12 |
13 | 14 |
15 | 16 | 17 |
18 | 19 |
20 | 21 |
22 |
23 |
24 |
25 | -------------------------------------------------------------------------------- /client/src/app/components/book-detail/book-detail.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylut2000/Angular11-CRUD-with-NodeJS/a0d4490b1e32d25fdf5719eb94c7c9f2325f02df/client/src/app/components/book-detail/book-detail.component.scss -------------------------------------------------------------------------------- /client/src/app/components/book-detail/book-detail.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, NgZone, OnInit } from '@angular/core'; 2 | import { Router, ActivatedRoute } from '@angular/router'; 3 | import { CrudService } from '../../services/crud.service'; 4 | import { FormGroup, FormBuilder } from "@angular/forms"; 5 | 6 | @Component({ 7 | selector: 'app-book-detail', 8 | templateUrl: './book-detail.component.html', 9 | styleUrls: [ './book-detail.component.scss' ] 10 | }) 11 | export class BookDetailComponent implements OnInit { 12 | 13 | getId: any; 14 | updateForm: FormGroup; 15 | 16 | constructor ( 17 | public formBuilder: FormBuilder, 18 | private router: Router, 19 | private ngZone: NgZone, 20 | private activatedRoute: ActivatedRoute, 21 | private crudService: CrudService) { 22 | 23 | this.getId = this.activatedRoute.snapshot.paramMap.get('id'); 24 | 25 | this.crudService.GetBook(this.getId).subscribe(res => { 26 | this.updateForm.setValue({ 27 | name: res['name'], 28 | price: res['price'], 29 | description: res['description'] 30 | }); 31 | }); 32 | 33 | this.updateForm = this.formBuilder.group({ 34 | name: [''], 35 | price: [''], 36 | description: [''] 37 | }); 38 | 39 | } 40 | 41 | 42 | ngOnInit (): void { 43 | } 44 | 45 | 46 | onUpdate(): any { 47 | this.crudService.updateBook(this.getId, this.updateForm.value) 48 | .subscribe(() => { 49 | console.log('Data updated successfully!') 50 | this.ngZone.run(() => this.router.navigateByUrl('/books-list')) 51 | }, (err) => { 52 | console.log(err); 53 | }); 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /client/src/app/components/books-list/books-list.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |

Books List

4 |
5 | 6 |
7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 27 | 28 |
IdNamePriceDescriptionAction
{{book._id}}{{book.name}}{{book.price}}{{book.description}} 24 | 25 | 26 |
29 |
30 |
31 | -------------------------------------------------------------------------------- /client/src/app/components/books-list/books-list.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylut2000/Angular11-CRUD-with-NodeJS/a0d4490b1e32d25fdf5719eb94c7c9f2325f02df/client/src/app/components/books-list/books-list.component.scss -------------------------------------------------------------------------------- /client/src/app/components/books-list/books-list.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { CrudService } from '../../services/crud.service'; 3 | 4 | @Component({ 5 | selector: 'app-books-list', 6 | templateUrl: './books-list.component.html', 7 | styleUrls: ['./books-list.component.scss'] 8 | }) 9 | export class BooksListComponent implements OnInit { 10 | 11 | Books:any = []; 12 | 13 | constructor(private crudService: CrudService) { } 14 | 15 | ngOnInit(): void { 16 | 17 | this.crudService.GetBooks().subscribe(res => { 18 | console.log(res) 19 | this.Books =res; 20 | }); 21 | } 22 | 23 | 24 | delete(id:string, i:number) { 25 | console.log(id); 26 | if(window.confirm('Do you want to go ahead?')) { 27 | this.crudService.deleteBook(id).subscribe((res) => { 28 | this.Books.splice(i, 1); 29 | }) 30 | } 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /client/src/app/models/Book.ts: -------------------------------------------------------------------------------- 1 | export class Book { 2 | _id!: String; 3 | name!: String; 4 | price!: String; 5 | description!: String; 6 | } 7 | -------------------------------------------------------------------------------- /client/src/app/services/crud.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { catchError, map } from 'rxjs/operators'; 3 | import { Observable, throwError } from 'rxjs'; 4 | import { HttpClient, HttpHeaders, HttpErrorResponse } from '@angular/common/http'; 5 | import { Book } from '../models/Book'; 6 | 7 | @Injectable({ 8 | providedIn: 'root' 9 | }) 10 | export class CrudService { 11 | 12 | // Node/Express API 13 | REST_API: string = 'http://localhost:5000/books'; 14 | 15 | // Http Header 16 | httpHeaders = new HttpHeaders().set('Content-Type', 'application/json'); 17 | 18 | constructor (private httpClient: HttpClient) { } 19 | 20 | // Add 21 | AddBook (data: Book): Observable { 22 | 23 | return this.httpClient.post(this.REST_API, data) 24 | .pipe( 25 | catchError(this.handleError) 26 | ) 27 | } 28 | 29 | 30 | // Get all objects 31 | GetBooks () { 32 | return this.httpClient.get(this.REST_API); 33 | } 34 | 35 | 36 | // Get single object 37 | GetBook (id: any): Observable { 38 | let API_URL = `${this.REST_API}/${id}`; 39 | return this.httpClient.get(API_URL, { headers: this.httpHeaders }) 40 | .pipe(map((res: any) => { 41 | return res || {} 42 | }), 43 | catchError(this.handleError) 44 | ) 45 | } 46 | 47 | 48 | // Update 49 | updateBook (id: string, data: any): Observable { 50 | let API_URL = `${this.REST_API}/${id}`; 51 | return this.httpClient.put(API_URL, data, { headers: this.httpHeaders }) 52 | .pipe( 53 | catchError(this.handleError) 54 | ) 55 | } 56 | 57 | 58 | // Delete 59 | deleteBook (id: string): Observable { 60 | let API_URL = `${this.REST_API}/${id}`; 61 | return this.httpClient.delete(API_URL, { headers: this.httpHeaders }).pipe( 62 | catchError(this.handleError) 63 | ) 64 | } 65 | 66 | 67 | // Error 68 | handleError (error: HttpErrorResponse) { 69 | let errorMessage = ''; 70 | if (error.error instanceof ErrorEvent) { 71 | // Handle client error 72 | errorMessage = error.error.message; 73 | } else { 74 | // Handle server error 75 | errorMessage = `Error Code: ${error.status}\nMessage: ${error.message}`; 76 | } 77 | console.log(errorMessage); 78 | return throwError(errorMessage); 79 | } 80 | 81 | } 82 | -------------------------------------------------------------------------------- /client/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylut2000/Angular11-CRUD-with-NodeJS/a0d4490b1e32d25fdf5719eb94c7c9f2325f02df/client/src/assets/.gitkeep -------------------------------------------------------------------------------- /client/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /client/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false 7 | }; 8 | 9 | /* 10 | * For easier debugging in development mode, you can import the following file 11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 12 | * 13 | * This import should be commented out in production mode because it will have a negative impact 14 | * on performance if an error is thrown. 15 | */ 16 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /client/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylut2000/Angular11-CRUD-with-NodeJS/a0d4490b1e32d25fdf5719eb94c7c9f2325f02df/client/src/favicon.ico -------------------------------------------------------------------------------- /client/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Client 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /client/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.error(err)); 13 | -------------------------------------------------------------------------------- /client/src/polyfills.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This file includes polyfills needed by Angular and is loaded before the app. 3 | * You can add your own extra polyfills to this file. 4 | * 5 | * This file is divided into 2 sections: 6 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. 7 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main 8 | * file. 9 | * 10 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that 11 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), 12 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. 13 | * 14 | * Learn more in https://angular.io/guide/browser-support 15 | */ 16 | 17 | /*************************************************************************************************** 18 | * BROWSER POLYFILLS 19 | */ 20 | 21 | /** 22 | * IE11 requires the following for NgClass support on SVG elements 23 | */ 24 | // import 'classlist.js'; // Run `npm install --save classlist.js`. 25 | 26 | /** 27 | * Web Animations `@angular/platform-browser/animations` 28 | * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. 29 | * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). 30 | */ 31 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 32 | 33 | /** 34 | * By default, zone.js will patch all possible macroTask and DomEvents 35 | * user can disable parts of macroTask/DomEvents patch by setting following flags 36 | * because those flags need to be set before `zone.js` being loaded, and webpack 37 | * will put import in the top of bundle, so user need to create a separate file 38 | * in this directory (for example: zone-flags.ts), and put the following flags 39 | * into that file, and then add the following code before importing zone.js. 40 | * import './zone-flags'; 41 | * 42 | * The flags allowed in zone-flags.ts are listed here. 43 | * 44 | * The following flags will work for all browsers. 45 | * 46 | * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame 47 | * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick 48 | * (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames 49 | * 50 | * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js 51 | * with the following flag, it will bypass `zone.js` patch for IE/Edge 52 | * 53 | * (window as any).__Zone_enable_cross_context_check = true; 54 | * 55 | */ 56 | 57 | /*************************************************************************************************** 58 | * Zone JS is required by default for Angular itself. 59 | */ 60 | import 'zone.js/dist/zone'; // Included with Angular CLI. 61 | 62 | 63 | /*************************************************************************************************** 64 | * APPLICATION IMPORTS 65 | */ 66 | -------------------------------------------------------------------------------- /client/src/styles.scss: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /client/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | declare const require: { 11 | context(path: string, deep?: boolean, filter?: RegExp): { 12 | keys(): string[]; 13 | (id: string): T; 14 | }; 15 | }; 16 | 17 | // First, initialize the Angular testing environment. 18 | getTestBed().initTestEnvironment( 19 | BrowserDynamicTestingModule, 20 | platformBrowserDynamicTesting() 21 | ); 22 | // Then we find all the tests. 23 | const context = require.context('./', true, /\.spec\.ts$/); 24 | // And load the modules. 25 | context.keys().map(context); 26 | -------------------------------------------------------------------------------- /client/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/app", 6 | "types": [] 7 | }, 8 | "files": [ 9 | "src/main.ts", 10 | "src/polyfills.ts" 11 | ], 12 | "include": [ 13 | "src/**/*.d.ts" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /client/tsconfig.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "compileOnSave": false, 4 | "compilerOptions": { 5 | "baseUrl": "./", 6 | "outDir": "./dist/out-tsc", 7 | "sourceMap": true, 8 | "declaration": false, 9 | "downlevelIteration": true, 10 | "experimentalDecorators": true, 11 | "moduleResolution": "node", 12 | "importHelpers": true, 13 | "target": "es2015", 14 | "module": "es2020", 15 | "lib": [ 16 | "es2018", 17 | "dom" 18 | ] 19 | }, 20 | "angularCompilerOptions": { 21 | "enableI18nLegacyMessageIdFormat": false 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /client/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/spec", 6 | "types": [ 7 | "jasmine" 8 | ] 9 | }, 10 | "files": [ 11 | "src/test.ts", 12 | "src/polyfills.ts" 13 | ], 14 | "include": [ 15 | "src/**/*.spec.ts", 16 | "src/**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /client/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "tslint:recommended", 3 | "rulesDirectory": [ 4 | "codelyzer" 5 | ], 6 | "rules": { 7 | "align": { 8 | "options": [ 9 | "parameters", 10 | "statements" 11 | ] 12 | }, 13 | "array-type": false, 14 | "arrow-return-shorthand": true, 15 | "curly": true, 16 | "deprecation": { 17 | "severity": "warning" 18 | }, 19 | "eofline": true, 20 | "import-blacklist": [ 21 | true, 22 | "rxjs/Rx" 23 | ], 24 | "import-spacing": true, 25 | "indent": { 26 | "options": [ 27 | "spaces" 28 | ] 29 | }, 30 | "max-classes-per-file": false, 31 | "max-line-length": [ 32 | true, 33 | 140 34 | ], 35 | "member-ordering": [ 36 | true, 37 | { 38 | "order": [ 39 | "static-field", 40 | "instance-field", 41 | "static-method", 42 | "instance-method" 43 | ] 44 | } 45 | ], 46 | "no-console": [ 47 | true, 48 | "debug", 49 | "info", 50 | "time", 51 | "timeEnd", 52 | "trace" 53 | ], 54 | "no-empty": false, 55 | "no-inferrable-types": [ 56 | true, 57 | "ignore-params" 58 | ], 59 | "no-non-null-assertion": true, 60 | "no-redundant-jsdoc": true, 61 | "no-switch-case-fall-through": true, 62 | "no-var-requires": false, 63 | "object-literal-key-quotes": [ 64 | true, 65 | "as-needed" 66 | ], 67 | "quotemark": [ 68 | true, 69 | "single" 70 | ], 71 | "semicolon": { 72 | "options": [ 73 | "always" 74 | ] 75 | }, 76 | "space-before-function-paren": { 77 | "options": { 78 | "anonymous": "never", 79 | "asyncArrow": "always", 80 | "constructor": "never", 81 | "method": "never", 82 | "named": "never" 83 | } 84 | }, 85 | "typedef": [ 86 | true, 87 | "call-signature" 88 | ], 89 | "typedef-whitespace": { 90 | "options": [ 91 | { 92 | "call-signature": "nospace", 93 | "index-signature": "nospace", 94 | "parameter": "nospace", 95 | "property-declaration": "nospace", 96 | "variable-declaration": "nospace" 97 | }, 98 | { 99 | "call-signature": "onespace", 100 | "index-signature": "onespace", 101 | "parameter": "onespace", 102 | "property-declaration": "onespace", 103 | "variable-declaration": "onespace" 104 | } 105 | ] 106 | }, 107 | "variable-name": { 108 | "options": [ 109 | "ban-keywords", 110 | "check-format", 111 | "allow-pascal-case" 112 | ] 113 | }, 114 | "whitespace": { 115 | "options": [ 116 | "check-branch", 117 | "check-decl", 118 | "check-operator", 119 | "check-separator", 120 | "check-type", 121 | "check-typecast" 122 | ] 123 | }, 124 | "component-class-suffix": true, 125 | "contextual-lifecycle": true, 126 | "directive-class-suffix": true, 127 | "no-conflicting-lifecycle": true, 128 | "no-host-metadata-property": true, 129 | "no-input-rename": true, 130 | "no-inputs-metadata-property": true, 131 | "no-output-native": true, 132 | "no-output-on-prefix": true, 133 | "no-output-rename": true, 134 | "no-outputs-metadata-property": true, 135 | "template-banana-in-box": true, 136 | "template-no-negated-async": true, 137 | "use-lifecycle-interface": true, 138 | "use-pipe-transform-interface": true, 139 | "directive-selector": [ 140 | true, 141 | "attribute", 142 | "app", 143 | "camelCase" 144 | ], 145 | "component-selector": [ 146 | true, 147 | "element", 148 | "app", 149 | "kebab-case" 150 | ] 151 | } 152 | } 153 | -------------------------------------------------------------------------------- /docker-compose.yaml: -------------------------------------------------------------------------------- 1 | version: '2' # specify docker-compose version 2 | # Define the services/containers to be run 3 | services: 4 | client: #name of the first service 5 | build: client # specify the directory of the Dockerfile 6 | ports: 7 | - "4200:4200" # specify port forewarding 8 | container_name: client-container 9 | restart: always 10 | server: #name of the second service 11 | build: server # specify the directory of the Dockerfile 12 | ports: 13 | - "5000:5000" #specify ports forewarding 14 | container_name: server-container 15 | restart: always 16 | -------------------------------------------------------------------------------- /server/.dockerignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | node_modules 3 | npm-debug.log 4 | Dockerfile* 5 | docker-compose* 6 | .dockerignore 7 | .git 8 | .gitignore 9 | README.md 10 | LICENSE 11 | .vscode 12 | -------------------------------------------------------------------------------- /server/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | .gitlab-ci-example.txt 3 | 4 | # dependencies 5 | /node_modules 6 | /.pnp 7 | .pnp.js 8 | 9 | # testing 10 | /coverage 11 | 12 | # production 13 | /build 14 | 15 | # misc 16 | .DS_Store 17 | .env.local 18 | .env.development.local 19 | .env.test.local 20 | .env.production.local 21 | 22 | npm-debug.log* 23 | yarn-debug.log* 24 | yarn-error.log* 25 | -------------------------------------------------------------------------------- /server/Dockerfile: -------------------------------------------------------------------------------- 1 | # Create image based on the official Node 6 image from the dockerhub 2 | FROM node:14.15.0-alpine3.10 3 | 4 | # Create a directory where our app will be placed 5 | RUN mkdir -p /usr/src/app 6 | 7 | # Change directory so that our commands run inside this new directory 8 | WORKDIR /usr/src/app 9 | 10 | # Copy dependency definitions 11 | COPY package.json /usr/src/app 12 | 13 | # Install dependecies 14 | RUN npm install 15 | 16 | # Get all the code needed to run the app 17 | COPY . /usr/src/app 18 | 19 | # Expose the port the app runs in 20 | EXPOSE 5000 21 | 22 | # Serve the app 23 | CMD ["npm", "start"] 24 | -------------------------------------------------------------------------------- /server/app.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const path = require('path'); 3 | const mongoose = require('mongoose'); 4 | const morgan = require('morgan'); 5 | const cors = require('cors'); 6 | const bodyParser = require('body-parser'); 7 | 8 | // init app 9 | const app = express(); 10 | // db URL, ⚠️ use an environment variable for this 11 | const DB_URL = process.env.DB_URL || 'mongodb://localhost:27017/books'; 12 | // get Port from .environment variable or use 5000 13 | const PORT = process.env.PORT || 5000; 14 | // routes 15 | const bookRoute = require('./routes/book'); 16 | 17 | // log 18 | app.use(morgan('dev')); 19 | // use cross origine access 20 | app.use(cors()); 21 | app.use(bodyParser.json()); 22 | app.use(bodyParser.urlencoded({ extended: false })); 23 | // use routes 24 | app.use('/books', bookRoute); 25 | 26 | mongoose.Promise = global.Promise; 27 | mongoose 28 | .connect(DB_URL, { 29 | useNewUrlParser: true, 30 | useFindAndModify: false, 31 | useUnifiedTopology: true, 32 | }) 33 | .then( 34 | () => console.log('Database connected'), 35 | (error) => console.log('Database error: ' + error) 36 | ); 37 | 38 | // error handler 39 | app.use(function (err, req, res, next) { 40 | console.error(err.message); 41 | if (!err.statusCode) err.statusCode = 500; 42 | res.status(err.statusCode).json({ error: err.message }); 43 | }); 44 | 45 | app.listen(PORT, () => console.log(`App listening on port:${PORT}`)); 46 | -------------------------------------------------------------------------------- /server/controllers/book.js: -------------------------------------------------------------------------------- 1 | const Book = require('../models/book'); 2 | 3 | // returns books 4 | exports.getBooks = (req, res, next) => { 5 | Book.find((error, data) => { 6 | if (error) { 7 | return next(error); 8 | } else { 9 | res.status(200).json(data); 10 | } 11 | }); 12 | }; 13 | 14 | // add book 15 | exports.addBook = (req, res, next) => { 16 | Book.create(req.body, (error, data) => { 17 | if (error) { 18 | return next(error); 19 | } else { 20 | res.json(data); 21 | } 22 | }); 23 | }; 24 | 25 | // edit book 26 | exports.editBook = (req, res, next) => { 27 | Book.findByIdAndUpdate(req.params.id, { $set: req.body }, (error, data) => { 28 | if (error) { 29 | return next(error); 30 | } else { 31 | res.status(201).json(data); 32 | } 33 | }); 34 | }; 35 | 36 | // delete book 37 | exports.deleteBook = (req, res, next) => { 38 | Book.findByIdAndRemove(req.params.id, (error, data) => { 39 | if (error) { 40 | return next(error); 41 | } else { 42 | res.status(200).json({ 43 | msg: data, 44 | }); 45 | } 46 | }); 47 | }; 48 | 49 | 50 | // get one book 51 | exports.getBookById = (req, res, next) => { 52 | Book.findById(req.params.id, (error, data) => { 53 | if (error) { 54 | return next(error) 55 | } else { 56 | res.json(data) 57 | } 58 | }) 59 | }; 60 | -------------------------------------------------------------------------------- /server/models/Book.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose'); 2 | 3 | // Book model 4 | const bookSchema = new mongoose.Schema({ 5 | name: { 6 | type: String 7 | }, 8 | price: { 9 | type: Number 10 | }, 11 | description: { 12 | type: String 13 | } 14 | }, { 15 | collection: 'books' 16 | }); 17 | 18 | module.exports = mongoose.model('Book', bookSchema); -------------------------------------------------------------------------------- /server/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "server", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "@sindresorhus/is": { 8 | "version": "0.14.0", 9 | "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", 10 | "integrity": "sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==" 11 | }, 12 | "@szmarczak/http-timer": { 13 | "version": "1.1.2", 14 | "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-1.1.2.tgz", 15 | "integrity": "sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA==", 16 | "requires": { 17 | "defer-to-connect": "^1.0.1" 18 | } 19 | }, 20 | "@types/bson": { 21 | "version": "4.0.3", 22 | "resolved": "https://registry.npmjs.org/@types/bson/-/bson-4.0.3.tgz", 23 | "integrity": "sha512-mVRvYnTOZJz3ccpxhr3wgxVmSeiYinW+zlzQz3SXWaJmD1DuL05Jeq7nKw3SnbKmbleW5qrLG5vdyWe/A9sXhw==", 24 | "requires": { 25 | "@types/node": "*" 26 | } 27 | }, 28 | "@types/mongodb": { 29 | "version": "3.6.9", 30 | "resolved": "https://registry.npmjs.org/@types/mongodb/-/mongodb-3.6.9.tgz", 31 | "integrity": "sha512-2XSGr/+IOKeFQ5tU9ATcIiIr7bpHqWyOXNGLOOhp0kg2NnfEvoKZF1SZ25j4zvJRqM2WeSUjfWSvymFJ3HBGJQ==", 32 | "requires": { 33 | "@types/bson": "*", 34 | "@types/node": "*" 35 | } 36 | }, 37 | "@types/node": { 38 | "version": "14.14.32", 39 | "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.32.tgz", 40 | "integrity": "sha512-/Ctrftx/zp4m8JOujM5ZhwzlWLx22nbQJiVqz8/zE15gOeEW+uly3FSX4fGFpcfEvFzXcMCJwq9lGVWgyARXhg==" 41 | }, 42 | "abbrev": { 43 | "version": "1.1.1", 44 | "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", 45 | "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" 46 | }, 47 | "accepts": { 48 | "version": "1.3.7", 49 | "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", 50 | "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", 51 | "requires": { 52 | "mime-types": "~2.1.24", 53 | "negotiator": "0.6.2" 54 | } 55 | }, 56 | "ansi-align": { 57 | "version": "3.0.0", 58 | "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.0.tgz", 59 | "integrity": "sha512-ZpClVKqXN3RGBmKibdfWzqCY4lnjEuoNzU5T0oEFpfd/z5qJHVarukridD4juLO2FXMiwUQxr9WqQtaYa8XRYw==", 60 | "requires": { 61 | "string-width": "^3.0.0" 62 | }, 63 | "dependencies": { 64 | "string-width": { 65 | "version": "3.1.0", 66 | "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", 67 | "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", 68 | "requires": { 69 | "emoji-regex": "^7.0.1", 70 | "is-fullwidth-code-point": "^2.0.0", 71 | "strip-ansi": "^5.1.0" 72 | } 73 | } 74 | } 75 | }, 76 | "ansi-regex": { 77 | "version": "4.1.0", 78 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", 79 | "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" 80 | }, 81 | "ansi-styles": { 82 | "version": "4.3.0", 83 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", 84 | "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", 85 | "requires": { 86 | "color-convert": "^2.0.1" 87 | } 88 | }, 89 | "anymatch": { 90 | "version": "3.1.1", 91 | "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", 92 | "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", 93 | "requires": { 94 | "normalize-path": "^3.0.0", 95 | "picomatch": "^2.0.4" 96 | } 97 | }, 98 | "array-flatten": { 99 | "version": "1.1.1", 100 | "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", 101 | "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" 102 | }, 103 | "balanced-match": { 104 | "version": "1.0.0", 105 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", 106 | "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" 107 | }, 108 | "basic-auth": { 109 | "version": "2.0.1", 110 | "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.1.tgz", 111 | "integrity": "sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==", 112 | "requires": { 113 | "safe-buffer": "5.1.2" 114 | } 115 | }, 116 | "binary-extensions": { 117 | "version": "2.2.0", 118 | "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", 119 | "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==" 120 | }, 121 | "bl": { 122 | "version": "2.2.1", 123 | "resolved": "https://registry.npmjs.org/bl/-/bl-2.2.1.tgz", 124 | "integrity": "sha512-6Pesp1w0DEX1N550i/uGV/TqucVL4AM/pgThFSN/Qq9si1/DF9aIHs1BxD8V/QU0HoeHO6cQRTAuYnLPKq1e4g==", 125 | "requires": { 126 | "readable-stream": "^2.3.5", 127 | "safe-buffer": "^5.1.1" 128 | } 129 | }, 130 | "bluebird": { 131 | "version": "3.5.1", 132 | "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz", 133 | "integrity": "sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==" 134 | }, 135 | "body-parser": { 136 | "version": "1.19.0", 137 | "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", 138 | "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==", 139 | "requires": { 140 | "bytes": "3.1.0", 141 | "content-type": "~1.0.4", 142 | "debug": "2.6.9", 143 | "depd": "~1.1.2", 144 | "http-errors": "1.7.2", 145 | "iconv-lite": "0.4.24", 146 | "on-finished": "~2.3.0", 147 | "qs": "6.7.0", 148 | "raw-body": "2.4.0", 149 | "type-is": "~1.6.17" 150 | } 151 | }, 152 | "boxen": { 153 | "version": "4.2.0", 154 | "resolved": "https://registry.npmjs.org/boxen/-/boxen-4.2.0.tgz", 155 | "integrity": "sha512-eB4uT9RGzg2odpER62bBwSLvUeGC+WbRjjyyFhGsKnc8wp/m0+hQsMUvUe3H2V0D5vw0nBdO1hCJoZo5mKeuIQ==", 156 | "requires": { 157 | "ansi-align": "^3.0.0", 158 | "camelcase": "^5.3.1", 159 | "chalk": "^3.0.0", 160 | "cli-boxes": "^2.2.0", 161 | "string-width": "^4.1.0", 162 | "term-size": "^2.1.0", 163 | "type-fest": "^0.8.1", 164 | "widest-line": "^3.1.0" 165 | } 166 | }, 167 | "brace-expansion": { 168 | "version": "1.1.11", 169 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", 170 | "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", 171 | "requires": { 172 | "balanced-match": "^1.0.0", 173 | "concat-map": "0.0.1" 174 | } 175 | }, 176 | "braces": { 177 | "version": "3.0.2", 178 | "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", 179 | "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", 180 | "requires": { 181 | "fill-range": "^7.0.1" 182 | } 183 | }, 184 | "bson": { 185 | "version": "1.1.5", 186 | "resolved": "https://registry.npmjs.org/bson/-/bson-1.1.5.tgz", 187 | "integrity": "sha512-kDuEzldR21lHciPQAIulLs1LZlCXdLziXI6Mb/TDkwXhb//UORJNPXgcRs2CuO4H0DcMkpfT3/ySsP3unoZjBg==" 188 | }, 189 | "bytes": { 190 | "version": "3.1.0", 191 | "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", 192 | "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==" 193 | }, 194 | "cacheable-request": { 195 | "version": "6.1.0", 196 | "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-6.1.0.tgz", 197 | "integrity": "sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg==", 198 | "requires": { 199 | "clone-response": "^1.0.2", 200 | "get-stream": "^5.1.0", 201 | "http-cache-semantics": "^4.0.0", 202 | "keyv": "^3.0.0", 203 | "lowercase-keys": "^2.0.0", 204 | "normalize-url": "^4.1.0", 205 | "responselike": "^1.0.2" 206 | }, 207 | "dependencies": { 208 | "get-stream": { 209 | "version": "5.2.0", 210 | "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", 211 | "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", 212 | "requires": { 213 | "pump": "^3.0.0" 214 | } 215 | }, 216 | "lowercase-keys": { 217 | "version": "2.0.0", 218 | "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", 219 | "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==" 220 | } 221 | } 222 | }, 223 | "camelcase": { 224 | "version": "5.3.1", 225 | "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", 226 | "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" 227 | }, 228 | "chalk": { 229 | "version": "3.0.0", 230 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", 231 | "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", 232 | "requires": { 233 | "ansi-styles": "^4.1.0", 234 | "supports-color": "^7.1.0" 235 | }, 236 | "dependencies": { 237 | "has-flag": { 238 | "version": "4.0.0", 239 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", 240 | "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" 241 | }, 242 | "supports-color": { 243 | "version": "7.2.0", 244 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", 245 | "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", 246 | "requires": { 247 | "has-flag": "^4.0.0" 248 | } 249 | } 250 | } 251 | }, 252 | "chokidar": { 253 | "version": "3.5.1", 254 | "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.1.tgz", 255 | "integrity": "sha512-9+s+Od+W0VJJzawDma/gvBNQqkTiqYTWLuZoyAsivsI4AaWTCzHG06/TMjsf1cYe9Cb97UCEhjz7HvnPk2p/tw==", 256 | "requires": { 257 | "anymatch": "~3.1.1", 258 | "braces": "~3.0.2", 259 | "fsevents": "~2.3.1", 260 | "glob-parent": "~5.1.0", 261 | "is-binary-path": "~2.1.0", 262 | "is-glob": "~4.0.1", 263 | "normalize-path": "~3.0.0", 264 | "readdirp": "~3.5.0" 265 | } 266 | }, 267 | "ci-info": { 268 | "version": "2.0.0", 269 | "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", 270 | "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==" 271 | }, 272 | "cli-boxes": { 273 | "version": "2.2.1", 274 | "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.1.tgz", 275 | "integrity": "sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw==" 276 | }, 277 | "clone-response": { 278 | "version": "1.0.2", 279 | "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", 280 | "integrity": "sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=", 281 | "requires": { 282 | "mimic-response": "^1.0.0" 283 | } 284 | }, 285 | "color-convert": { 286 | "version": "2.0.1", 287 | "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", 288 | "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", 289 | "requires": { 290 | "color-name": "~1.1.4" 291 | } 292 | }, 293 | "color-name": { 294 | "version": "1.1.4", 295 | "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", 296 | "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" 297 | }, 298 | "concat-map": { 299 | "version": "0.0.1", 300 | "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", 301 | "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" 302 | }, 303 | "configstore": { 304 | "version": "5.0.1", 305 | "resolved": "https://registry.npmjs.org/configstore/-/configstore-5.0.1.tgz", 306 | "integrity": "sha512-aMKprgk5YhBNyH25hj8wGt2+D52Sw1DRRIzqBwLp2Ya9mFmY8KPvvtvmna8SxVR9JMZ4kzMD68N22vlaRpkeFA==", 307 | "requires": { 308 | "dot-prop": "^5.2.0", 309 | "graceful-fs": "^4.1.2", 310 | "make-dir": "^3.0.0", 311 | "unique-string": "^2.0.0", 312 | "write-file-atomic": "^3.0.0", 313 | "xdg-basedir": "^4.0.0" 314 | } 315 | }, 316 | "content-disposition": { 317 | "version": "0.5.3", 318 | "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", 319 | "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", 320 | "requires": { 321 | "safe-buffer": "5.1.2" 322 | } 323 | }, 324 | "content-type": { 325 | "version": "1.0.4", 326 | "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", 327 | "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" 328 | }, 329 | "cookie": { 330 | "version": "0.4.0", 331 | "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz", 332 | "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==" 333 | }, 334 | "cookie-signature": { 335 | "version": "1.0.6", 336 | "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", 337 | "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" 338 | }, 339 | "core-util-is": { 340 | "version": "1.0.2", 341 | "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", 342 | "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" 343 | }, 344 | "cors": { 345 | "version": "2.8.5", 346 | "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", 347 | "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", 348 | "requires": { 349 | "object-assign": "^4", 350 | "vary": "^1" 351 | } 352 | }, 353 | "crypto-random-string": { 354 | "version": "2.0.0", 355 | "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz", 356 | "integrity": "sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==" 357 | }, 358 | "debug": { 359 | "version": "2.6.9", 360 | "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", 361 | "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", 362 | "requires": { 363 | "ms": "2.0.0" 364 | } 365 | }, 366 | "decompress-response": { 367 | "version": "3.3.0", 368 | "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", 369 | "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", 370 | "requires": { 371 | "mimic-response": "^1.0.0" 372 | } 373 | }, 374 | "deep-extend": { 375 | "version": "0.6.0", 376 | "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", 377 | "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==" 378 | }, 379 | "defer-to-connect": { 380 | "version": "1.1.3", 381 | "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.3.tgz", 382 | "integrity": "sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ==" 383 | }, 384 | "denque": { 385 | "version": "1.5.0", 386 | "resolved": "https://registry.npmjs.org/denque/-/denque-1.5.0.tgz", 387 | "integrity": "sha512-CYiCSgIF1p6EUByQPlGkKnP1M9g0ZV3qMIrqMqZqdwazygIA/YP2vrbcyl1h/WppKJTdl1F85cXIle+394iDAQ==" 388 | }, 389 | "depd": { 390 | "version": "1.1.2", 391 | "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", 392 | "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" 393 | }, 394 | "destroy": { 395 | "version": "1.0.4", 396 | "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", 397 | "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" 398 | }, 399 | "dot-prop": { 400 | "version": "5.3.0", 401 | "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", 402 | "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==", 403 | "requires": { 404 | "is-obj": "^2.0.0" 405 | } 406 | }, 407 | "duplexer3": { 408 | "version": "0.1.4", 409 | "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", 410 | "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=" 411 | }, 412 | "ee-first": { 413 | "version": "1.1.1", 414 | "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", 415 | "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" 416 | }, 417 | "emoji-regex": { 418 | "version": "7.0.3", 419 | "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", 420 | "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==" 421 | }, 422 | "encodeurl": { 423 | "version": "1.0.2", 424 | "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", 425 | "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" 426 | }, 427 | "end-of-stream": { 428 | "version": "1.4.4", 429 | "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", 430 | "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", 431 | "requires": { 432 | "once": "^1.4.0" 433 | } 434 | }, 435 | "escape-goat": { 436 | "version": "2.1.1", 437 | "resolved": "https://registry.npmjs.org/escape-goat/-/escape-goat-2.1.1.tgz", 438 | "integrity": "sha512-8/uIhbG12Csjy2JEW7D9pHbreaVaS/OpN3ycnyvElTdwM5n6GY6W6e2IPemfvGZeUMqZ9A/3GqIZMgKnBhAw/Q==" 439 | }, 440 | "escape-html": { 441 | "version": "1.0.3", 442 | "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", 443 | "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" 444 | }, 445 | "etag": { 446 | "version": "1.8.1", 447 | "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", 448 | "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" 449 | }, 450 | "express": { 451 | "version": "4.17.1", 452 | "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", 453 | "integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==", 454 | "requires": { 455 | "accepts": "~1.3.7", 456 | "array-flatten": "1.1.1", 457 | "body-parser": "1.19.0", 458 | "content-disposition": "0.5.3", 459 | "content-type": "~1.0.4", 460 | "cookie": "0.4.0", 461 | "cookie-signature": "1.0.6", 462 | "debug": "2.6.9", 463 | "depd": "~1.1.2", 464 | "encodeurl": "~1.0.2", 465 | "escape-html": "~1.0.3", 466 | "etag": "~1.8.1", 467 | "finalhandler": "~1.1.2", 468 | "fresh": "0.5.2", 469 | "merge-descriptors": "1.0.1", 470 | "methods": "~1.1.2", 471 | "on-finished": "~2.3.0", 472 | "parseurl": "~1.3.3", 473 | "path-to-regexp": "0.1.7", 474 | "proxy-addr": "~2.0.5", 475 | "qs": "6.7.0", 476 | "range-parser": "~1.2.1", 477 | "safe-buffer": "5.1.2", 478 | "send": "0.17.1", 479 | "serve-static": "1.14.1", 480 | "setprototypeof": "1.1.1", 481 | "statuses": "~1.5.0", 482 | "type-is": "~1.6.18", 483 | "utils-merge": "1.0.1", 484 | "vary": "~1.1.2" 485 | } 486 | }, 487 | "fill-range": { 488 | "version": "7.0.1", 489 | "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", 490 | "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", 491 | "requires": { 492 | "to-regex-range": "^5.0.1" 493 | } 494 | }, 495 | "finalhandler": { 496 | "version": "1.1.2", 497 | "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", 498 | "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", 499 | "requires": { 500 | "debug": "2.6.9", 501 | "encodeurl": "~1.0.2", 502 | "escape-html": "~1.0.3", 503 | "on-finished": "~2.3.0", 504 | "parseurl": "~1.3.3", 505 | "statuses": "~1.5.0", 506 | "unpipe": "~1.0.0" 507 | } 508 | }, 509 | "forwarded": { 510 | "version": "0.1.2", 511 | "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", 512 | "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=" 513 | }, 514 | "fresh": { 515 | "version": "0.5.2", 516 | "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", 517 | "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" 518 | }, 519 | "fsevents": { 520 | "version": "2.3.2", 521 | "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", 522 | "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", 523 | "optional": true 524 | }, 525 | "get-stream": { 526 | "version": "4.1.0", 527 | "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", 528 | "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", 529 | "requires": { 530 | "pump": "^3.0.0" 531 | } 532 | }, 533 | "glob-parent": { 534 | "version": "5.1.2", 535 | "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", 536 | "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", 537 | "requires": { 538 | "is-glob": "^4.0.1" 539 | } 540 | }, 541 | "global-dirs": { 542 | "version": "2.1.0", 543 | "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-2.1.0.tgz", 544 | "integrity": "sha512-MG6kdOUh/xBnyo9cJFeIKkLEc1AyFq42QTU4XiX51i2NEdxLxLWXIjEjmqKeSuKR7pAZjTqUVoT2b2huxVLgYQ==", 545 | "requires": { 546 | "ini": "1.3.7" 547 | } 548 | }, 549 | "got": { 550 | "version": "9.6.0", 551 | "resolved": "https://registry.npmjs.org/got/-/got-9.6.0.tgz", 552 | "integrity": "sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q==", 553 | "requires": { 554 | "@sindresorhus/is": "^0.14.0", 555 | "@szmarczak/http-timer": "^1.1.2", 556 | "cacheable-request": "^6.0.0", 557 | "decompress-response": "^3.3.0", 558 | "duplexer3": "^0.1.4", 559 | "get-stream": "^4.1.0", 560 | "lowercase-keys": "^1.0.1", 561 | "mimic-response": "^1.0.1", 562 | "p-cancelable": "^1.0.0", 563 | "to-readable-stream": "^1.0.0", 564 | "url-parse-lax": "^3.0.0" 565 | } 566 | }, 567 | "graceful-fs": { 568 | "version": "4.2.6", 569 | "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz", 570 | "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==" 571 | }, 572 | "has-flag": { 573 | "version": "3.0.0", 574 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", 575 | "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" 576 | }, 577 | "has-yarn": { 578 | "version": "2.1.0", 579 | "resolved": "https://registry.npmjs.org/has-yarn/-/has-yarn-2.1.0.tgz", 580 | "integrity": "sha512-UqBRqi4ju7T+TqGNdqAO0PaSVGsDGJUBQvk9eUWNGRY1CFGDzYhLWoM7JQEemnlvVcv/YEmc2wNW8BC24EnUsw==" 581 | }, 582 | "http-cache-semantics": { 583 | "version": "4.1.0", 584 | "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", 585 | "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==" 586 | }, 587 | "http-errors": { 588 | "version": "1.7.2", 589 | "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", 590 | "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", 591 | "requires": { 592 | "depd": "~1.1.2", 593 | "inherits": "2.0.3", 594 | "setprototypeof": "1.1.1", 595 | "statuses": ">= 1.5.0 < 2", 596 | "toidentifier": "1.0.0" 597 | } 598 | }, 599 | "iconv-lite": { 600 | "version": "0.4.24", 601 | "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", 602 | "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", 603 | "requires": { 604 | "safer-buffer": ">= 2.1.2 < 3" 605 | } 606 | }, 607 | "ignore-by-default": { 608 | "version": "1.0.1", 609 | "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", 610 | "integrity": "sha1-SMptcvbGo68Aqa1K5odr44ieKwk=" 611 | }, 612 | "import-lazy": { 613 | "version": "2.1.0", 614 | "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz", 615 | "integrity": "sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM=" 616 | }, 617 | "imurmurhash": { 618 | "version": "0.1.4", 619 | "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", 620 | "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=" 621 | }, 622 | "inherits": { 623 | "version": "2.0.3", 624 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", 625 | "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" 626 | }, 627 | "ini": { 628 | "version": "1.3.7", 629 | "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.7.tgz", 630 | "integrity": "sha512-iKpRpXP+CrP2jyrxvg1kMUpXDyRUFDWurxbnVT1vQPx+Wz9uCYsMIqYuSBLV+PAaZG/d7kRLKRFc9oDMsH+mFQ==" 631 | }, 632 | "ipaddr.js": { 633 | "version": "1.9.1", 634 | "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", 635 | "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" 636 | }, 637 | "is-binary-path": { 638 | "version": "2.1.0", 639 | "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", 640 | "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", 641 | "requires": { 642 | "binary-extensions": "^2.0.0" 643 | } 644 | }, 645 | "is-ci": { 646 | "version": "2.0.0", 647 | "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", 648 | "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", 649 | "requires": { 650 | "ci-info": "^2.0.0" 651 | } 652 | }, 653 | "is-extglob": { 654 | "version": "2.1.1", 655 | "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", 656 | "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" 657 | }, 658 | "is-fullwidth-code-point": { 659 | "version": "2.0.0", 660 | "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", 661 | "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" 662 | }, 663 | "is-glob": { 664 | "version": "4.0.1", 665 | "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", 666 | "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", 667 | "requires": { 668 | "is-extglob": "^2.1.1" 669 | } 670 | }, 671 | "is-installed-globally": { 672 | "version": "0.3.2", 673 | "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.3.2.tgz", 674 | "integrity": "sha512-wZ8x1js7Ia0kecP/CHM/3ABkAmujX7WPvQk6uu3Fly/Mk44pySulQpnHG46OMjHGXApINnV4QhY3SWnECO2z5g==", 675 | "requires": { 676 | "global-dirs": "^2.0.1", 677 | "is-path-inside": "^3.0.1" 678 | } 679 | }, 680 | "is-npm": { 681 | "version": "4.0.0", 682 | "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-4.0.0.tgz", 683 | "integrity": "sha512-96ECIfh9xtDDlPylNPXhzjsykHsMJZ18ASpaWzQyBr4YRTcVjUvzaHayDAES2oU/3KpljhHUjtSRNiDwi0F0ig==" 684 | }, 685 | "is-number": { 686 | "version": "7.0.0", 687 | "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", 688 | "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" 689 | }, 690 | "is-obj": { 691 | "version": "2.0.0", 692 | "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", 693 | "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==" 694 | }, 695 | "is-path-inside": { 696 | "version": "3.0.3", 697 | "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", 698 | "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==" 699 | }, 700 | "is-typedarray": { 701 | "version": "1.0.0", 702 | "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", 703 | "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" 704 | }, 705 | "is-yarn-global": { 706 | "version": "0.3.0", 707 | "resolved": "https://registry.npmjs.org/is-yarn-global/-/is-yarn-global-0.3.0.tgz", 708 | "integrity": "sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw==" 709 | }, 710 | "isarray": { 711 | "version": "1.0.0", 712 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", 713 | "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" 714 | }, 715 | "json-buffer": { 716 | "version": "3.0.0", 717 | "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", 718 | "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=" 719 | }, 720 | "kareem": { 721 | "version": "2.3.2", 722 | "resolved": "https://registry.npmjs.org/kareem/-/kareem-2.3.2.tgz", 723 | "integrity": "sha512-STHz9P7X2L4Kwn72fA4rGyqyXdmrMSdxqHx9IXon/FXluXieaFA6KJ2upcHAHxQPQ0LeM/OjLrhFxifHewOALQ==" 724 | }, 725 | "keyv": { 726 | "version": "3.1.0", 727 | "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.1.0.tgz", 728 | "integrity": "sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA==", 729 | "requires": { 730 | "json-buffer": "3.0.0" 731 | } 732 | }, 733 | "latest-version": { 734 | "version": "5.1.0", 735 | "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-5.1.0.tgz", 736 | "integrity": "sha512-weT+r0kTkRQdCdYCNtkMwWXQTMEswKrFBkm4ckQOMVhhqhIMI1UT2hMj+1iigIhgSZm5gTmrRXBNoGUgaTY1xA==", 737 | "requires": { 738 | "package-json": "^6.3.0" 739 | } 740 | }, 741 | "lowercase-keys": { 742 | "version": "1.0.1", 743 | "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", 744 | "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==" 745 | }, 746 | "make-dir": { 747 | "version": "3.1.0", 748 | "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", 749 | "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", 750 | "requires": { 751 | "semver": "^6.0.0" 752 | }, 753 | "dependencies": { 754 | "semver": { 755 | "version": "6.3.0", 756 | "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", 757 | "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" 758 | } 759 | } 760 | }, 761 | "media-typer": { 762 | "version": "0.3.0", 763 | "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", 764 | "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" 765 | }, 766 | "memory-pager": { 767 | "version": "1.5.0", 768 | "resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.5.0.tgz", 769 | "integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==", 770 | "optional": true 771 | }, 772 | "merge-descriptors": { 773 | "version": "1.0.1", 774 | "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", 775 | "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" 776 | }, 777 | "methods": { 778 | "version": "1.1.2", 779 | "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", 780 | "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" 781 | }, 782 | "mime": { 783 | "version": "1.6.0", 784 | "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", 785 | "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" 786 | }, 787 | "mime-db": { 788 | "version": "1.46.0", 789 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.46.0.tgz", 790 | "integrity": "sha512-svXaP8UQRZ5K7or+ZmfNhg2xX3yKDMUzqadsSqi4NCH/KomcH75MAMYAGVlvXn4+b/xOPhS3I2uHKRUzvjY7BQ==" 791 | }, 792 | "mime-types": { 793 | "version": "2.1.29", 794 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.29.tgz", 795 | "integrity": "sha512-Y/jMt/S5sR9OaqteJtslsFZKWOIIqMACsJSiHghlCAyhf7jfVYjKBmLiX8OgpWeW+fjJ2b+Az69aPFPkUOY6xQ==", 796 | "requires": { 797 | "mime-db": "1.46.0" 798 | } 799 | }, 800 | "mimic-response": { 801 | "version": "1.0.1", 802 | "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", 803 | "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==" 804 | }, 805 | "minimatch": { 806 | "version": "3.0.4", 807 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", 808 | "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", 809 | "requires": { 810 | "brace-expansion": "^1.1.7" 811 | } 812 | }, 813 | "minimist": { 814 | "version": "1.2.5", 815 | "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", 816 | "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" 817 | }, 818 | "mongodb": { 819 | "version": "3.6.4", 820 | "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.6.4.tgz", 821 | "integrity": "sha512-Y+Ki9iXE9jI+n9bVtbTOOdK0B95d6wVGSucwtBkvQ+HIvVdTCfpVRp01FDC24uhC/Q2WXQ8Lpq3/zwtB5Op9Qw==", 822 | "requires": { 823 | "bl": "^2.2.1", 824 | "bson": "^1.1.4", 825 | "denque": "^1.4.1", 826 | "require_optional": "^1.0.1", 827 | "safe-buffer": "^5.1.2", 828 | "saslprep": "^1.0.0" 829 | } 830 | }, 831 | "mongoose": { 832 | "version": "5.11.19", 833 | "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.11.19.tgz", 834 | "integrity": "sha512-+oMf4XVg+j7ygnALi7K5vWZfKvC9gs9jdN/6Y1GV5OUAc7KQWoa6hzFO7nSj5jMJlhHNvC6tcS2uU7BV5aH8Lg==", 835 | "requires": { 836 | "@types/mongodb": "^3.5.27", 837 | "bson": "^1.1.4", 838 | "kareem": "2.3.2", 839 | "mongodb": "3.6.4", 840 | "mongoose-legacy-pluralize": "1.0.2", 841 | "mpath": "0.8.3", 842 | "mquery": "3.2.4", 843 | "ms": "2.1.2", 844 | "regexp-clone": "1.0.0", 845 | "safe-buffer": "5.2.1", 846 | "sift": "7.0.1", 847 | "sliced": "1.0.1" 848 | }, 849 | "dependencies": { 850 | "ms": { 851 | "version": "2.1.2", 852 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", 853 | "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" 854 | }, 855 | "safe-buffer": { 856 | "version": "5.2.1", 857 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", 858 | "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" 859 | } 860 | } 861 | }, 862 | "mongoose-legacy-pluralize": { 863 | "version": "1.0.2", 864 | "resolved": "https://registry.npmjs.org/mongoose-legacy-pluralize/-/mongoose-legacy-pluralize-1.0.2.tgz", 865 | "integrity": "sha512-Yo/7qQU4/EyIS8YDFSeenIvXxZN+ld7YdV9LqFVQJzTLye8unujAWPZ4NWKfFA+RNjh+wvTWKY9Z3E5XM6ZZiQ==" 866 | }, 867 | "morgan": { 868 | "version": "1.10.0", 869 | "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.10.0.tgz", 870 | "integrity": "sha512-AbegBVI4sh6El+1gNwvD5YIck7nSA36weD7xvIxG4in80j/UoK8AEGaWnnz8v1GxonMCltmlNs5ZKbGvl9b1XQ==", 871 | "requires": { 872 | "basic-auth": "~2.0.1", 873 | "debug": "2.6.9", 874 | "depd": "~2.0.0", 875 | "on-finished": "~2.3.0", 876 | "on-headers": "~1.0.2" 877 | }, 878 | "dependencies": { 879 | "depd": { 880 | "version": "2.0.0", 881 | "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", 882 | "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==" 883 | } 884 | } 885 | }, 886 | "mpath": { 887 | "version": "0.8.3", 888 | "resolved": "https://registry.npmjs.org/mpath/-/mpath-0.8.3.tgz", 889 | "integrity": "sha512-eb9rRvhDltXVNL6Fxd2zM9D4vKBxjVVQNLNijlj7uoXUy19zNDsIif5zR+pWmPCWNKwAtqyo4JveQm4nfD5+eA==" 890 | }, 891 | "mquery": { 892 | "version": "3.2.4", 893 | "resolved": "https://registry.npmjs.org/mquery/-/mquery-3.2.4.tgz", 894 | "integrity": "sha512-uOLpp7iRX0BV1Uu6YpsqJ5b42LwYnmu0WeF/f8qgD/On3g0XDaQM6pfn0m6UxO6SM8DioZ9Bk6xxbWIGHm2zHg==", 895 | "requires": { 896 | "bluebird": "3.5.1", 897 | "debug": "3.1.0", 898 | "regexp-clone": "^1.0.0", 899 | "safe-buffer": "5.1.2", 900 | "sliced": "1.0.1" 901 | }, 902 | "dependencies": { 903 | "debug": { 904 | "version": "3.1.0", 905 | "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", 906 | "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", 907 | "requires": { 908 | "ms": "2.0.0" 909 | } 910 | } 911 | } 912 | }, 913 | "ms": { 914 | "version": "2.0.0", 915 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", 916 | "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" 917 | }, 918 | "negotiator": { 919 | "version": "0.6.2", 920 | "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", 921 | "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==" 922 | }, 923 | "nodemon": { 924 | "version": "2.0.7", 925 | "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.7.tgz", 926 | "integrity": "sha512-XHzK69Awgnec9UzHr1kc8EomQh4sjTQ8oRf8TsGrSmHDx9/UmiGG9E/mM3BuTfNeFwdNBvrqQq/RHL0xIeyFOA==", 927 | "requires": { 928 | "chokidar": "^3.2.2", 929 | "debug": "^3.2.6", 930 | "ignore-by-default": "^1.0.1", 931 | "minimatch": "^3.0.4", 932 | "pstree.remy": "^1.1.7", 933 | "semver": "^5.7.1", 934 | "supports-color": "^5.5.0", 935 | "touch": "^3.1.0", 936 | "undefsafe": "^2.0.3", 937 | "update-notifier": "^4.1.0" 938 | }, 939 | "dependencies": { 940 | "debug": { 941 | "version": "3.2.7", 942 | "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", 943 | "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", 944 | "requires": { 945 | "ms": "^2.1.1" 946 | } 947 | }, 948 | "ms": { 949 | "version": "2.1.3", 950 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", 951 | "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" 952 | } 953 | } 954 | }, 955 | "nopt": { 956 | "version": "1.0.10", 957 | "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", 958 | "integrity": "sha1-bd0hvSoxQXuScn3Vhfim83YI6+4=", 959 | "requires": { 960 | "abbrev": "1" 961 | } 962 | }, 963 | "normalize-path": { 964 | "version": "3.0.0", 965 | "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", 966 | "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" 967 | }, 968 | "normalize-url": { 969 | "version": "4.5.0", 970 | "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.0.tgz", 971 | "integrity": "sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ==" 972 | }, 973 | "object-assign": { 974 | "version": "4.1.1", 975 | "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", 976 | "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" 977 | }, 978 | "on-finished": { 979 | "version": "2.3.0", 980 | "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", 981 | "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", 982 | "requires": { 983 | "ee-first": "1.1.1" 984 | } 985 | }, 986 | "on-headers": { 987 | "version": "1.0.2", 988 | "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", 989 | "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==" 990 | }, 991 | "once": { 992 | "version": "1.4.0", 993 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", 994 | "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", 995 | "requires": { 996 | "wrappy": "1" 997 | } 998 | }, 999 | "p-cancelable": { 1000 | "version": "1.1.0", 1001 | "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", 1002 | "integrity": "sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==" 1003 | }, 1004 | "package-json": { 1005 | "version": "6.5.0", 1006 | "resolved": "https://registry.npmjs.org/package-json/-/package-json-6.5.0.tgz", 1007 | "integrity": "sha512-k3bdm2n25tkyxcjSKzB5x8kfVxlMdgsbPr0GkZcwHsLpba6cBjqCt1KlcChKEvxHIcTB1FVMuwoijZ26xex5MQ==", 1008 | "requires": { 1009 | "got": "^9.6.0", 1010 | "registry-auth-token": "^4.0.0", 1011 | "registry-url": "^5.0.0", 1012 | "semver": "^6.2.0" 1013 | }, 1014 | "dependencies": { 1015 | "semver": { 1016 | "version": "6.3.0", 1017 | "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", 1018 | "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" 1019 | } 1020 | } 1021 | }, 1022 | "parseurl": { 1023 | "version": "1.3.3", 1024 | "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", 1025 | "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" 1026 | }, 1027 | "path-to-regexp": { 1028 | "version": "0.1.7", 1029 | "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", 1030 | "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" 1031 | }, 1032 | "picomatch": { 1033 | "version": "2.2.2", 1034 | "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", 1035 | "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==" 1036 | }, 1037 | "prepend-http": { 1038 | "version": "2.0.0", 1039 | "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", 1040 | "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=" 1041 | }, 1042 | "process-nextick-args": { 1043 | "version": "2.0.1", 1044 | "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", 1045 | "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" 1046 | }, 1047 | "proxy-addr": { 1048 | "version": "2.0.6", 1049 | "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz", 1050 | "integrity": "sha512-dh/frvCBVmSsDYzw6n926jv974gddhkFPfiN8hPOi30Wax25QZyZEGveluCgliBnqmuM+UJmBErbAUFIoDbjOw==", 1051 | "requires": { 1052 | "forwarded": "~0.1.2", 1053 | "ipaddr.js": "1.9.1" 1054 | } 1055 | }, 1056 | "pstree.remy": { 1057 | "version": "1.1.8", 1058 | "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", 1059 | "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==" 1060 | }, 1061 | "pump": { 1062 | "version": "3.0.0", 1063 | "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", 1064 | "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", 1065 | "requires": { 1066 | "end-of-stream": "^1.1.0", 1067 | "once": "^1.3.1" 1068 | } 1069 | }, 1070 | "pupa": { 1071 | "version": "2.1.1", 1072 | "resolved": "https://registry.npmjs.org/pupa/-/pupa-2.1.1.tgz", 1073 | "integrity": "sha512-l1jNAspIBSFqbT+y+5FosojNpVpF94nlI+wDUpqP9enwOTfHx9f0gh5nB96vl+6yTpsJsypeNrwfzPrKuHB41A==", 1074 | "requires": { 1075 | "escape-goat": "^2.0.0" 1076 | } 1077 | }, 1078 | "qs": { 1079 | "version": "6.7.0", 1080 | "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", 1081 | "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==" 1082 | }, 1083 | "range-parser": { 1084 | "version": "1.2.1", 1085 | "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", 1086 | "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==" 1087 | }, 1088 | "raw-body": { 1089 | "version": "2.4.0", 1090 | "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz", 1091 | "integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==", 1092 | "requires": { 1093 | "bytes": "3.1.0", 1094 | "http-errors": "1.7.2", 1095 | "iconv-lite": "0.4.24", 1096 | "unpipe": "1.0.0" 1097 | } 1098 | }, 1099 | "rc": { 1100 | "version": "1.2.8", 1101 | "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", 1102 | "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", 1103 | "requires": { 1104 | "deep-extend": "^0.6.0", 1105 | "ini": "~1.3.0", 1106 | "minimist": "^1.2.0", 1107 | "strip-json-comments": "~2.0.1" 1108 | } 1109 | }, 1110 | "readable-stream": { 1111 | "version": "2.3.7", 1112 | "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", 1113 | "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", 1114 | "requires": { 1115 | "core-util-is": "~1.0.0", 1116 | "inherits": "~2.0.3", 1117 | "isarray": "~1.0.0", 1118 | "process-nextick-args": "~2.0.0", 1119 | "safe-buffer": "~5.1.1", 1120 | "string_decoder": "~1.1.1", 1121 | "util-deprecate": "~1.0.1" 1122 | } 1123 | }, 1124 | "readdirp": { 1125 | "version": "3.5.0", 1126 | "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.5.0.tgz", 1127 | "integrity": "sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ==", 1128 | "requires": { 1129 | "picomatch": "^2.2.1" 1130 | } 1131 | }, 1132 | "regexp-clone": { 1133 | "version": "1.0.0", 1134 | "resolved": "https://registry.npmjs.org/regexp-clone/-/regexp-clone-1.0.0.tgz", 1135 | "integrity": "sha512-TuAasHQNamyyJ2hb97IuBEif4qBHGjPHBS64sZwytpLEqtBQ1gPJTnOaQ6qmpET16cK14kkjbazl6+p0RRv0yw==" 1136 | }, 1137 | "registry-auth-token": { 1138 | "version": "4.2.1", 1139 | "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-4.2.1.tgz", 1140 | "integrity": "sha512-6gkSb4U6aWJB4SF2ZvLb76yCBjcvufXBqvvEx1HbmKPkutswjW1xNVRY0+daljIYRbogN7O0etYSlbiaEQyMyw==", 1141 | "requires": { 1142 | "rc": "^1.2.8" 1143 | } 1144 | }, 1145 | "registry-url": { 1146 | "version": "5.1.0", 1147 | "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-5.1.0.tgz", 1148 | "integrity": "sha512-8acYXXTI0AkQv6RAOjE3vOaIXZkT9wo4LOFbBKYQEEnnMNBpKqdUrI6S4NT0KPIo/WVvJ5tE/X5LF/TQUf0ekw==", 1149 | "requires": { 1150 | "rc": "^1.2.8" 1151 | } 1152 | }, 1153 | "require_optional": { 1154 | "version": "1.0.1", 1155 | "resolved": "https://registry.npmjs.org/require_optional/-/require_optional-1.0.1.tgz", 1156 | "integrity": "sha512-qhM/y57enGWHAe3v/NcwML6a3/vfESLe/sGM2dII+gEO0BpKRUkWZow/tyloNqJyN6kXSl3RyyM8Ll5D/sJP8g==", 1157 | "requires": { 1158 | "resolve-from": "^2.0.0", 1159 | "semver": "^5.1.0" 1160 | } 1161 | }, 1162 | "resolve-from": { 1163 | "version": "2.0.0", 1164 | "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-2.0.0.tgz", 1165 | "integrity": "sha1-lICrIOlP+h2egKgEx+oUdhGWa1c=" 1166 | }, 1167 | "responselike": { 1168 | "version": "1.0.2", 1169 | "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz", 1170 | "integrity": "sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=", 1171 | "requires": { 1172 | "lowercase-keys": "^1.0.0" 1173 | } 1174 | }, 1175 | "safe-buffer": { 1176 | "version": "5.1.2", 1177 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", 1178 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" 1179 | }, 1180 | "safer-buffer": { 1181 | "version": "2.1.2", 1182 | "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", 1183 | "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" 1184 | }, 1185 | "saslprep": { 1186 | "version": "1.0.3", 1187 | "resolved": "https://registry.npmjs.org/saslprep/-/saslprep-1.0.3.tgz", 1188 | "integrity": "sha512-/MY/PEMbk2SuY5sScONwhUDsV2p77Znkb/q3nSVstq/yQzYJOH/Azh29p9oJLsl3LnQwSvZDKagDGBsBwSooag==", 1189 | "optional": true, 1190 | "requires": { 1191 | "sparse-bitfield": "^3.0.3" 1192 | } 1193 | }, 1194 | "semver": { 1195 | "version": "5.7.1", 1196 | "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", 1197 | "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" 1198 | }, 1199 | "semver-diff": { 1200 | "version": "3.1.1", 1201 | "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-3.1.1.tgz", 1202 | "integrity": "sha512-GX0Ix/CJcHyB8c4ykpHGIAvLyOwOobtM/8d+TQkAd81/bEjgPHrfba41Vpesr7jX/t8Uh+R3EX9eAS5be+jQYg==", 1203 | "requires": { 1204 | "semver": "^6.3.0" 1205 | }, 1206 | "dependencies": { 1207 | "semver": { 1208 | "version": "6.3.0", 1209 | "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", 1210 | "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" 1211 | } 1212 | } 1213 | }, 1214 | "send": { 1215 | "version": "0.17.1", 1216 | "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", 1217 | "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==", 1218 | "requires": { 1219 | "debug": "2.6.9", 1220 | "depd": "~1.1.2", 1221 | "destroy": "~1.0.4", 1222 | "encodeurl": "~1.0.2", 1223 | "escape-html": "~1.0.3", 1224 | "etag": "~1.8.1", 1225 | "fresh": "0.5.2", 1226 | "http-errors": "~1.7.2", 1227 | "mime": "1.6.0", 1228 | "ms": "2.1.1", 1229 | "on-finished": "~2.3.0", 1230 | "range-parser": "~1.2.1", 1231 | "statuses": "~1.5.0" 1232 | }, 1233 | "dependencies": { 1234 | "ms": { 1235 | "version": "2.1.1", 1236 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", 1237 | "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" 1238 | } 1239 | } 1240 | }, 1241 | "serve-static": { 1242 | "version": "1.14.1", 1243 | "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", 1244 | "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==", 1245 | "requires": { 1246 | "encodeurl": "~1.0.2", 1247 | "escape-html": "~1.0.3", 1248 | "parseurl": "~1.3.3", 1249 | "send": "0.17.1" 1250 | } 1251 | }, 1252 | "setprototypeof": { 1253 | "version": "1.1.1", 1254 | "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", 1255 | "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==" 1256 | }, 1257 | "sift": { 1258 | "version": "7.0.1", 1259 | "resolved": "https://registry.npmjs.org/sift/-/sift-7.0.1.tgz", 1260 | "integrity": "sha512-oqD7PMJ+uO6jV9EQCl0LrRw1OwsiPsiFQR5AR30heR+4Dl7jBBbDLnNvWiak20tzZlSE1H7RB30SX/1j/YYT7g==" 1261 | }, 1262 | "signal-exit": { 1263 | "version": "3.0.3", 1264 | "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", 1265 | "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==" 1266 | }, 1267 | "sliced": { 1268 | "version": "1.0.1", 1269 | "resolved": "https://registry.npmjs.org/sliced/-/sliced-1.0.1.tgz", 1270 | "integrity": "sha1-CzpmK10Ewxd7GSa+qCsD+Dei70E=" 1271 | }, 1272 | "sparse-bitfield": { 1273 | "version": "3.0.3", 1274 | "resolved": "https://registry.npmjs.org/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz", 1275 | "integrity": "sha1-/0rm5oZWBWuks+eSqzM004JzyhE=", 1276 | "optional": true, 1277 | "requires": { 1278 | "memory-pager": "^1.0.2" 1279 | } 1280 | }, 1281 | "statuses": { 1282 | "version": "1.5.0", 1283 | "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", 1284 | "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" 1285 | }, 1286 | "string-width": { 1287 | "version": "4.2.2", 1288 | "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", 1289 | "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", 1290 | "requires": { 1291 | "emoji-regex": "^8.0.0", 1292 | "is-fullwidth-code-point": "^3.0.0", 1293 | "strip-ansi": "^6.0.0" 1294 | }, 1295 | "dependencies": { 1296 | "ansi-regex": { 1297 | "version": "5.0.0", 1298 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", 1299 | "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==" 1300 | }, 1301 | "emoji-regex": { 1302 | "version": "8.0.0", 1303 | "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", 1304 | "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" 1305 | }, 1306 | "is-fullwidth-code-point": { 1307 | "version": "3.0.0", 1308 | "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", 1309 | "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" 1310 | }, 1311 | "strip-ansi": { 1312 | "version": "6.0.0", 1313 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", 1314 | "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", 1315 | "requires": { 1316 | "ansi-regex": "^5.0.0" 1317 | } 1318 | } 1319 | } 1320 | }, 1321 | "string_decoder": { 1322 | "version": "1.1.1", 1323 | "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", 1324 | "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", 1325 | "requires": { 1326 | "safe-buffer": "~5.1.0" 1327 | } 1328 | }, 1329 | "strip-ansi": { 1330 | "version": "5.2.0", 1331 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", 1332 | "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", 1333 | "requires": { 1334 | "ansi-regex": "^4.1.0" 1335 | } 1336 | }, 1337 | "strip-json-comments": { 1338 | "version": "2.0.1", 1339 | "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", 1340 | "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" 1341 | }, 1342 | "supports-color": { 1343 | "version": "5.5.0", 1344 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", 1345 | "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", 1346 | "requires": { 1347 | "has-flag": "^3.0.0" 1348 | } 1349 | }, 1350 | "term-size": { 1351 | "version": "2.2.1", 1352 | "resolved": "https://registry.npmjs.org/term-size/-/term-size-2.2.1.tgz", 1353 | "integrity": "sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg==" 1354 | }, 1355 | "to-readable-stream": { 1356 | "version": "1.0.0", 1357 | "resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-1.0.0.tgz", 1358 | "integrity": "sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q==" 1359 | }, 1360 | "to-regex-range": { 1361 | "version": "5.0.1", 1362 | "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", 1363 | "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", 1364 | "requires": { 1365 | "is-number": "^7.0.0" 1366 | } 1367 | }, 1368 | "toidentifier": { 1369 | "version": "1.0.0", 1370 | "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", 1371 | "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==" 1372 | }, 1373 | "touch": { 1374 | "version": "3.1.0", 1375 | "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz", 1376 | "integrity": "sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==", 1377 | "requires": { 1378 | "nopt": "~1.0.10" 1379 | } 1380 | }, 1381 | "type-fest": { 1382 | "version": "0.8.1", 1383 | "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", 1384 | "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==" 1385 | }, 1386 | "type-is": { 1387 | "version": "1.6.18", 1388 | "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", 1389 | "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", 1390 | "requires": { 1391 | "media-typer": "0.3.0", 1392 | "mime-types": "~2.1.24" 1393 | } 1394 | }, 1395 | "typedarray-to-buffer": { 1396 | "version": "3.1.5", 1397 | "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", 1398 | "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", 1399 | "requires": { 1400 | "is-typedarray": "^1.0.0" 1401 | } 1402 | }, 1403 | "undefsafe": { 1404 | "version": "2.0.3", 1405 | "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.3.tgz", 1406 | "integrity": "sha512-nrXZwwXrD/T/JXeygJqdCO6NZZ1L66HrxM/Z7mIq2oPanoN0F1nLx3lwJMu6AwJY69hdixaFQOuoYsMjE5/C2A==", 1407 | "requires": { 1408 | "debug": "^2.2.0" 1409 | } 1410 | }, 1411 | "unique-string": { 1412 | "version": "2.0.0", 1413 | "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz", 1414 | "integrity": "sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg==", 1415 | "requires": { 1416 | "crypto-random-string": "^2.0.0" 1417 | } 1418 | }, 1419 | "unpipe": { 1420 | "version": "1.0.0", 1421 | "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", 1422 | "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" 1423 | }, 1424 | "update-notifier": { 1425 | "version": "4.1.3", 1426 | "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-4.1.3.tgz", 1427 | "integrity": "sha512-Yld6Z0RyCYGB6ckIjffGOSOmHXj1gMeE7aROz4MG+XMkmixBX4jUngrGXNYz7wPKBmtoD4MnBa2Anu7RSKht/A==", 1428 | "requires": { 1429 | "boxen": "^4.2.0", 1430 | "chalk": "^3.0.0", 1431 | "configstore": "^5.0.1", 1432 | "has-yarn": "^2.1.0", 1433 | "import-lazy": "^2.1.0", 1434 | "is-ci": "^2.0.0", 1435 | "is-installed-globally": "^0.3.1", 1436 | "is-npm": "^4.0.0", 1437 | "is-yarn-global": "^0.3.0", 1438 | "latest-version": "^5.0.0", 1439 | "pupa": "^2.0.1", 1440 | "semver-diff": "^3.1.1", 1441 | "xdg-basedir": "^4.0.0" 1442 | } 1443 | }, 1444 | "url-parse-lax": { 1445 | "version": "3.0.0", 1446 | "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", 1447 | "integrity": "sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=", 1448 | "requires": { 1449 | "prepend-http": "^2.0.0" 1450 | } 1451 | }, 1452 | "util-deprecate": { 1453 | "version": "1.0.2", 1454 | "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", 1455 | "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" 1456 | }, 1457 | "utils-merge": { 1458 | "version": "1.0.1", 1459 | "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", 1460 | "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" 1461 | }, 1462 | "vary": { 1463 | "version": "1.1.2", 1464 | "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", 1465 | "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" 1466 | }, 1467 | "widest-line": { 1468 | "version": "3.1.0", 1469 | "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", 1470 | "integrity": "sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==", 1471 | "requires": { 1472 | "string-width": "^4.0.0" 1473 | } 1474 | }, 1475 | "wrappy": { 1476 | "version": "1.0.2", 1477 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", 1478 | "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" 1479 | }, 1480 | "write-file-atomic": { 1481 | "version": "3.0.3", 1482 | "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", 1483 | "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", 1484 | "requires": { 1485 | "imurmurhash": "^0.1.4", 1486 | "is-typedarray": "^1.0.0", 1487 | "signal-exit": "^3.0.2", 1488 | "typedarray-to-buffer": "^3.1.5" 1489 | } 1490 | }, 1491 | "xdg-basedir": { 1492 | "version": "4.0.0", 1493 | "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-4.0.0.tgz", 1494 | "integrity": "sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==" 1495 | } 1496 | } 1497 | } 1498 | -------------------------------------------------------------------------------- /server/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "server", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "start": "nodemon app.js" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "body-parser": "^1.19.0", 14 | "cors": "^2.8.5", 15 | "express": "^4.17.1", 16 | "mongoose": "^5.11.19", 17 | "morgan": "^1.10.0", 18 | "nodemon": "^2.0.7" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /server/routes/book.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const router = express.Router(); 3 | 4 | const { 5 | getBooks, 6 | addBook, 7 | editBook, 8 | deleteBook, 9 | getBookById, 10 | } = require('../controllers/book'); 11 | 12 | // Get Book 13 | router.get('/', getBooks); 14 | // Add Book 15 | router.post('/', addBook); 16 | // Edit Book 17 | router.put('/:id', editBook); 18 | // Delete Book 19 | router.delete('/:id', deleteBook); 20 | // get Book by Id 21 | router.get('/:id', getBookById); 22 | 23 | module.exports = router; 24 | --------------------------------------------------------------------------------