-
This repo is containing two other folders, api and react-web
-
api (back): deal with node api. it has also its readme file.
-
react-web (front) deal with how to connect front to back end with proxy. It also has its readme file
Mongoose: Mongoose is a MongoDB object modelling tool designed to work in an asynchronous environment.
1- node
2- in node: const person =require(‘./api/model/person.js’) note: for this code we have to be out of directory
3- in node command: person=Person.create({firstName:'John', lastName:'Rambo'})
if person not available make a new one OR if it is available switch to.
in terminal:
mongo (will start mongo server)
show dbs (show available databases)
use <database name> (switch to database)
db.< database name> .find() ( will show entire databse)
show collections < show collections entire may availbale entir database.
db.dropDatabase() (drop database note: need to be on database which need to drop)
yarn add passport passport-local passport-local-mongoose