CRUD/React Node Express MongoDB
-
3.Login FunctionalityCRUD/React Node Express MongoDB 2022. 9. 6. 17:52
Login.jsx function Login(){ // copy Register.jsx } APIRoutes export const loginRoute = `${host}/api/auth/login`; usersControllers.js module.exports.login = async (req, res, next) => { try { const { username, password } = req.body; const user = await User.findOne({ username }); if (!user) return res.json({ msg: "Incorrect username or password", status: false }); const isPasswordValid = await bcry..
-
2. Register FunctionalityCRUD/React Node Express MongoDB 2022. 9. 6. 11:15
In Public Part Register.jsx import React, { useState } from 'react' import { Link, useNavigate } from 'react-router-dom'; import styled from 'styled-components' import Logo from '../assets/logo.svg' import { ToastContainer, toast } from "react-toastify"; import "react-toastify/dist/ReactToastify.css"; import axios from "axios"; import { registerRoute } from '../utils/APIRoutes'; function Registe..
-
Chat App 1. Base SetupCRUD/React Node Express MongoDB 2022. 9. 1. 01:09
I learned from this Youtube https://www.youtube.com/watch?v=otaQKODEUFs Make two folder > server & public Inside the public npx create-react-app chat-app Inside the server npm init npm i express mongoose nodemon socket.io bcrypt cors dotenv Make index.js Inside the package.json "scripts": { "test": "echo \"Error: no test specified\" && exit 1" , "start": "nodemon index.js" }, Inside the Index.js..