This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | 'use strict'; | |
| module.exports = (sequelize, DataTypes) => { | |
| const Review = sequelize.define( | |
| 'Review', | |
| { | |
| title: { | |
| type: DataTypes.STRING, | |
| allowNull: false, | |
| validate: { | |
| len: [2, 100], | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | 'use strict'; | |
| const Op = require('sequelize').Op; | |
| module.exports = (sequelize, DataTypes) => { | |
| const Book = sequelize.define( | |
| 'Book', | |
| { | |
| title: { | |
| type: DataTypes.STRING, | |
| allowNull: false, | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | 'use strict'; | |
| module.exports = { | |
| up: (queryInterface, Sequelize) => | |
| queryInterface.createTable('Reviews', { | |
| id: { | |
| allowNull: false, | |
| autoIncrement: true, | |
| primaryKey: true, | |
| type: Sequelize.INTEGER, | |
| }, | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | 'use strict'; | |
| module.exports = { | |
| up: (queryInterface, Sequelize) => | |
| queryInterface.createTable('Books', { | |
| id: { | |
| allowNull: false, | |
| autoIncrement: true, | |
| primaryKey: true, | |
| type: Sequelize.INTEGER, | |
| }, | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | const path = require('path'); | |
| module.exports = { | |
| 'config': path.resolve('server', 'config', 'database.js'), | |
| 'models-path': path.resolve('server', 'sequelize', 'models'), | |
| 'seeders-path': path.resolve('server', 'sequelize', 'seeders'), | |
| 'migrations-path': path.resolve('server', 'sequelize', 'migrations') | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import { Router } from 'express'; | |
| const router = Router(); | |
| router.get('/', (req, res, next) => | |
| res.status(200).json({ | |
| message: 'Welcome to Books REST API by The JavaScript Dojo', | |
| }), | |
| ); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import express from 'express'; | |
| import bodyParser from 'body-parser'; | |
| import helmet from 'helmet'; | |
| import router from './routes'; | |
| const app = express(); | |
| const { NODE_ENV, PORT = 3000 } = process.env; | |
| const isProduction = NODE_ENV === 'production'; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              Show hidden characters
| { | |
| "presets": [ | |
| "env" | |
| ] | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // import describe and it from mocha as named exports | |
| import { describe, it } from 'mocha'; | |
| // import chai and chai-http from chai and chai-http libraries as default exports | |
| import chai from 'chai'; | |
| import chaiHttp from 'chai-http'; | |
| // import server from index.js as default export | |
| import server from '../../index'; | |
| /* | |
| * initialise chai to use chai-http | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | /* | |
| * 31.css is a css library created by CHIMA CHUKWUEMEKA [email protected] | |
| * for the Book-A-Meal project in Andela Cycle 31 Nigeria 2018 | |
| * | |
| * Just like w3.css, 31.css implores the same terminologies in order to provide a responsive UI | |
| * To use 31.css, call to-[property] you want to call as a class attribute value e.g | |
| * to-table, to-btn e.t.c | |
| */ | |
| * { |