This file contains 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 mongoose = require('mongoose'); | |
const bcrypt = require('bcrypt'); | |
const userSchema = new mongoose.Schema({ | |
username: { | |
type: String, | |
required: true, | |
unique: true, | |
lowercase: true, | |
// normalize all users to lowercase |
This file contains 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
// inside the middleware folder | |
module.exports = { | |
greeter, | |
logger, | |
errorHandler, | |
}; | |
function greeter(name) { | |
return function(req, res, next) { |
This file contains 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 mongoose = require('mongoose'); | |
const ObjectId = mongoose.Schema.Types.ObjectId; | |
const Character = mongoose.Schema({ | |
name: { type: String, required: true }, | |
edited: Date, | |
created: Date, | |
gender: String, | |
height: String, | |
hair_color: String, |
This file contains 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 mongoose = require('mongoose'); | |
const bcrypt = require('bcrypt'); //< =========== | |
const userSchema = new mongoose.Schema({ | |
username: { | |
type: String, | |
required: true, | |
unique: true, | |
lowercase: true, // Kyle => kyle | |
}, |
This file contains 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
// /src/App.js | |
import React, { Component } from 'react'; | |
import { Route, withRouter } from 'react-router-dom'; | |
import logo from './logo.svg'; | |
import './App.css'; | |
import Signin from './auth/Signin'; | |
import Users from './users/Users'; |
This file contains 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 utilities = require('../index'); | |
describe.skip('default', () => { | |
it('run the tests', () => {}); | |
}); | |
describe('add function', () => { | |
// afterAll(() => { | |
// console.log('after all ran'); | |
// }); |
This file contains 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
// /.gitignore | |
# See https://help.github.com/ignore-files/ for more about ignoring files. | |
# dependencies | |
/node_modules | |
# testing | |
/coverage |
This file contains 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
node_modules | |
.DS_Store | |
.vscode |
This file contains 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
// ./auth/UserModel.js | |
const mongoose = require('mongoose'); | |
const bcrypt = require('bcrypt'); | |
const userSchema = new mongoose.Schema({ | |
username: { | |
type: String, | |
unique: true, | |
required: true, |
This file contains 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
// ./client/src/App.js | |
import React, { Component } from 'react'; | |
import { Route, withRouter } from 'react-router-dom'; | |
import logo from './logo.svg'; | |
import './App.css'; | |
import Signin from './auth/Signin'; | |
import Users from './users/Users'; |
OlderNewer