Commit 1aa67949 authored by seoyeon's avatar seoyeon
Browse files

Merge remote-tracking branch 'origin/jaeyeoniiiiii' into seoyeon2

parents 38962780 a79f18a8
...@@ -13,7 +13,7 @@ const server = http.createServer(app); ...@@ -13,7 +13,7 @@ const server = http.createServer(app);
app.use(express.json()); app.use(express.json());
app.use(express.urlencoded({ extended: true })); app.use(express.urlencoded({ extended: true }));
app.use(cookieParser()); app.use(cookieParser());
app.use('/uploads', express.static('uploads'))
app.use("/api", mainRouter); app.use("/api", mainRouter);
let receiverPCs = {}; let receiverPCs = {};
......
...@@ -24,6 +24,9 @@ ...@@ -24,6 +24,9 @@
"test": "react-scripts test", "test": "react-scripts test",
"eject": "react-scripts eject" "eject": "react-scripts eject"
}, },
"nodemonConfig":{
"ignore":["test/*","docs/*","client/*"]
},
"eslintConfig": { "eslintConfig": {
"extends": [ "extends": [
"react-app", "react-app",
......
client/public/user.png

17.1 KB | W: | H:

client/public/user.png

16.3 KB | W: | H:

client/public/user.png
client/public/user.png
client/public/user.png
client/public/user.png
  • 2-up
  • Swipe
  • Onion skin
import axios from "axios";
const login = async (payload) => {
const { data } = await axios.post("/api/login", payload);
return data;
};
const signup = async (payload) => {
const { data } = await axios.post("/api/signup", payload);
return data;
};
const profileApi = { login, signup };
export default profileApi;
...@@ -15,6 +15,16 @@ const signup = async (payload) => { ...@@ -15,6 +15,16 @@ const signup = async (payload) => {
return data; return data;
}; };
const userApi = { getUser, login, signup }; const updateinfo = async (payload) => {
const { data } = await axios.put("/api/updateinfo", payload);
return data;
};
const profileimg = async (formData) => {
const { data } = await axios.put("/api/profileimg", formData);
return data;
};
const userApi = { login, signup, getUser, profileimg, updateinfo };
export default userApi; export default userApi;
...@@ -32,17 +32,17 @@ const HomeProfile = () => { ...@@ -32,17 +32,17 @@ const HomeProfile = () => {
}, [userprofile]) }, [userprofile])
return ( return (
<Link to={`/profile/${user}`} className="text-decoration-none text-dark"> <Link to={`/profile/${user.id}`} className="text-decoration-none text-dark">
<form className="flex-column align-items-center justify-content-center m-2"> <form className="flex-column align-items-center justify-content-center m-2">
<div className="d-flex justify-content-center"> <div className="d-flex justify-content-center">
<img <img
// src="cherry.jpg" src={`/uploads/${user.img}`}
className="rounded-circle" className="rounded-circle"
style={{ style={{
width: "157px", width: "157px",
height: "157px", height: "157px",
}} }}
value={user.img} // value={user.img}
/> />
</div> </div>
<h1 className="d-flex justify-content-center"> {user.name} </h1> <h1 className="d-flex justify-content-center"> {user.name} </h1>
......
import User from "../Room/User"; import userApi from "../../apis/user.api";
import { useEffect, useState } from "react";
const userprofile = localStorage.getItem("user");
const INIT_PROFILE = {
name: "",
email: "a",
id: "",
phone: "",
};
const Info = () => { const Info = () => {
const [profile, setProfile] = useState(INIT_PROFILE);
async function getProfile(userID) {
try {
const data = await userApi.getUser({id:userID});
setProfile(data);
console.log(data)
} catch (error) {}
}
useEffect(() => {
getProfile(userprofile);
}, [userprofile]);
return ( return (
<div className="container" style={{ background: "#FCF4FF" }}> <div className="container" style={{ background: "#FCF4FF" }}>
<div <div
className="row justify-content-center my-4" className="row justify-content-center my-4"
style={{ fontSize: "25px", fontWeight: "bold" }} style={{ fontSize: "25px", fontWeight: "bold" }}
> >
CHERRY #0805 {profile.email} #{profile.id}
</div> </div>
<div className="row"> <div className="row">
<div className="col-3"></div> <div className="col-3"></div>
...@@ -15,14 +39,24 @@ const Info = () => { ...@@ -15,14 +39,24 @@ const Info = () => {
<h2 className="mb-3" style={{ fontSize: "13px", fontWeight: "bold" }}> <h2 className="mb-3" style={{ fontSize: "13px", fontWeight: "bold" }}>
이름 이름
</h2> </h2>
<h2 className="mb-4 mt-2" style={{ fontSize: "25px", fontWeight: "bold" }} >김채린</h2> <h2
className="mb-4 mt-2"
style={{ fontSize: "25px", fontWeight: "bold" }}
>
{profile.name}
</h2>
<h2 <h2
className="mb-3 mt-2" className="mb-3 mt-2"
style={{ fontSize: "13px", fontWeight: "bold" }} style={{ fontSize: "13px", fontWeight: "bold" }}
> >
전화번호 전화번호
</h2> </h2>
<h2 className="mb-3 mt-2" style={{ fontSize: "25px", fontWeight: "bold" }}>010-8628-8984</h2> <h2
className="mb-3 mt-2"
style={{ fontSize: "25px", fontWeight: "bold" }}
>
{profile.phone}
</h2>
</div> </div>
<div className="col"></div> <div className="col"></div>
</div> </div>
......
import { Link } from "react-router-dom"; import { Link, useParams } from "react-router-dom";
import React, { useState } from "react"; import React, { useEffect, useState } from "react";
import userApi from "../../apis/user.api";
const userprofile = localStorage.getItem("user");
console.log(userprofile);
const INIT_PROFILE = {
id: userprofile,
name:"",
email:"",
phone:"",
img: "",
};
const InfoUpdate = () => { const InfoUpdate = () => {
// const INIT_ACCOUNT={ const { id } = useParams();
// name:"",
// }
const [profile, setProfile] = useState(INIT_PROFILE);
// const [account, setAccount] = useState(INIT_ACCOUNT) async function getProfile(userID) {
try {
const data = await userApi.getUser({ id: userID });
setProfile(data);
console.log(data);
} catch (error) {}
}
// const handleChange = (e)=>{ useEffect(() => {
// const {name, value, files}=e.target getProfile(userprofile);
// if(files){ }, []);
// setAccount({...account,[name]:files})
// console.log('aaaaaaa')
// } else{
// setAccount({...account, [name]:value})
// }
// }
const id = 1; const handleChange = async (event) => {
const number = 1234; const { files } = event.target;
let formData = new FormData();
formData.append("img", files[0]);
formData.append("id", userprofile);
try {
const res = await userApi.profileimg(formData);
console.log(res);
if(files){
setProfile({...profile, img:res})
}else{
setProfile()
} } catch (error) {}
};
const changeinfo = async (event) => {
console.log(profile);
const res = await userApi.updateinfo(profile)
};
const updateinfo = (event) => {
const { name, value } = event.target;
setProfile({ ...profile, [name]: value });
console.log(profile);
};
const{email,phone,name}=profile
return ( return (
<div className="container" style={{ background: "#FCF4FF" }}> <div className="container" style={{ background: "#FCF4FF" }}>
<div className="row"> <div className="row">
...@@ -43,6 +79,20 @@ const InfoUpdate = () => { ...@@ -43,6 +79,20 @@ const InfoUpdate = () => {
돌아가기 돌아가기
</button> </button>
</Link> </Link>
<Link to={`/profile/${id}`}>
<button
onClick={changeinfo}
type="button"
className="btn btn-outline-white mx-2 "
style={{
background: "#d4cafb",
fontSize: "13px",
fontWeight: "bold",
}}
>
저장
</button>
</Link>
</div> </div>
</div> </div>
...@@ -54,7 +104,7 @@ const InfoUpdate = () => { ...@@ -54,7 +104,7 @@ const InfoUpdate = () => {
style={{ position: "relative" }} style={{ position: "relative" }}
> >
<img <img
src="/cherry.jpg" src={`/uploads/${profile.img}`}
id="imgfile" id="imgfile"
className="rounded-circle mt-2" className="rounded-circle mt-2"
style={{ height: "320px", width: "320px" }} style={{ height: "320px", width: "320px" }}
...@@ -63,11 +113,10 @@ const InfoUpdate = () => { ...@@ -63,11 +113,10 @@ const InfoUpdate = () => {
className="d-flex justify-content-end" className="d-flex justify-content-end"
style={{ position: "absolute", left: "295px", top: "30px" }} style={{ position: "absolute", left: "295px", top: "30px" }}
> >
<label for="inputfile"> <label htmlFor="inputfile">
<img <img
className="rounded-circle" className="rounded-circle"
src="/infoimg.jpg" src="/infoimg.jpg"
// onChange={handleChange}
style={{ style={{
width: "50px", width: "50px",
height: "50px", height: "50px",
...@@ -76,6 +125,8 @@ const InfoUpdate = () => { ...@@ -76,6 +125,8 @@ const InfoUpdate = () => {
/> />
</label> </label>
<input <input
onChange={handleChange}
name="avatarUrl"
type="file" type="file"
accept="image/*" accept="image/*"
id="inputfile" id="inputfile"
...@@ -86,6 +137,9 @@ const InfoUpdate = () => { ...@@ -86,6 +137,9 @@ const InfoUpdate = () => {
<div className="col d-flex justify-content-center"> <div className="col d-flex justify-content-center">
<input <input
onChange={updateinfo}
name="email"
value={profile.email}
type="text" type="text"
className="form-control my-4 " className="form-control my-4 "
placeholder="사용자명 입력" placeholder="사용자명 입력"
...@@ -104,81 +158,63 @@ const InfoUpdate = () => { ...@@ -104,81 +158,63 @@ const InfoUpdate = () => {
className="justify-content-center ms-2 my-4" className="justify-content-center ms-2 my-4"
style={{ fontSize: "25px", fontWeight: "bold" }} style={{ fontSize: "25px", fontWeight: "bold" }}
> >
#{number} #{userprofile}
</div> </div>
</div> </div>
<div className="row">
<div className="col-3"></div>
<div className="col-6 my-2">
<h2
className="mb-3"
style={{ fontSize: "13px", fontWeight: "bold" }}
>
이름
</h2>
<input
onChange={updateinfo}
name="name"
value={profile.name}
type="text"
className="form-control my-3 "
placeholder="이름 입력"
style={{
background: "#fcf4ff",
borderTop: "0",
borderRight: "0",
borderLeft: "0",
borderBottom: "1",
borderColor: "#d4cafb",
height: "38px",
width: "180px",
}}
/>
<div className="d-flex justify-content-center"> <h2
<label className="mb-3 mt-2"
class="form-label me-3" style={{ fontSize: "13px", fontWeight: "bold" }}
style={{ >
outline: "none", 전화번호
fontSize: "13px", </h2>
fontWeight: "bold", <input
}} onChange={updateinfo}
> name="phone"
현재 비밀번호 value={profile.phone}
</label> type="text"
<input className="form-control my-3 "
type="password" placeholder="전화번호 입력"
class="form-control" style={{
style={{ height: "38px", width: "200px" }} background: "#fcf4ff",
/> borderTop: "0",
<button borderRight: "0",
type="button" borderLeft: "0",
className="btn btn-outline-white ms-2" borderBottom: "1",
style={{ borderColor: "#d4cafb",
background: "#d4cafb", height: "38px",
fontSize: "13px", width: "180px",
fontWeight: "bold", }}
}} />
>
수정하기
</button>
</div>
<div class="col-6">
<div class="input-group mx-2 my-3">
<div>
<label
class="form-label"
style={{ fontSize: "13px", fontWeight: "bold" }}
>
비밀번호
</label>
<input type="text" className="form-control" />
</div>
<div>
<label
className="form-label"
style={{ fontSize: "13px", fontWeight: "bold" }}
>
비밀번호 확인
</label>
<input type="text" className="form-control" />
</div>
</div>
</div>
<div className="col-6">
<div className="input-group my-3 ">
<div>
<label
className="form-label"
style={{ fontSize: "13px", fontWeight: "bold" }}
>
전화번호
</label>
<input type="text" className="form-control" />
</div>
<div>
<label
className="form-label"
style={{ fontSize: "13px", fontWeight: "bold" }}
>
전화번호 확인
</label>
<input type="text" className="form-control" />
</div>
</div> </div>
<div className="col"></div>
</div> </div>
</div> </div>
</div> </div>
......
import { Link } from "react-router-dom"; import { Link, useParams } from "react-router-dom";
import { useState, useEffect } from "react";
import userApi from "../../apis/user.api";
const userprofile = localStorage.getItem("user");
const INIT_PROFILE = {
img:"",
};
const Profile = () => { const Profile = () => {
const id = 1;
const [profile, setProfile] = useState(INIT_PROFILE);
async function getProfile(userID) {
try {
const data = await userApi.getUser({id:userID});
console.log(data.img)
setProfile(data.img)
} catch (error) {}
}
useEffect(() => {
getProfile(userprofile);
}, [userprofile]);
const { id } = useParams();
console.log(id);
return ( return (
<div className="container" style={{ background: "#FCF4FF" }}> <div className="container" style={{ background: "#FCF4FF" }}>
<> <>
...@@ -31,7 +57,7 @@ const Profile = () => { ...@@ -31,7 +57,7 @@ const Profile = () => {
<div className="col"> <div className="col">
<div className="d-flex justify-content-center"> <div className="d-flex justify-content-center">
<img <img
src="/cherry.jpg" src={`/uploads/${profile}`}
className="rounded-circle mt-2" className="rounded-circle mt-2"
style={{ height: "320px", width: "320px" }} style={{ height: "320px", width: "320px" }}
/> />
......
...@@ -37,7 +37,7 @@ const Signup = () => { ...@@ -37,7 +37,7 @@ const Signup = () => {
function handleChange(event) { function handleChange(event) {
const { name, value } = event.target; const { name, value } = event.target;
setUser({ ...user, [name]: value }); setUser({ ...user, [name]: value });
console.log(user); // console.log(user);
} }
async function handleSubmit() { async function handleSubmit() {
......
...@@ -105,9 +105,9 @@ ...@@ -105,9 +105,9 @@
browserslist "^4.14.5" browserslist "^4.14.5"
semver "^5.5.0" semver "^5.5.0"
"@babel/helper-create-class-features-plugin@^7.12.1", "@babel/helper-create-class-features-plugin@^7.12.13", "@babel/helper-create-class-features-plugin@^7.12.17": "@babel/helper-create-className-features-plugin@^7.12.1", "@babel/helper-create-className-features-plugin@^7.12.13", "@babel/helper-create-className-features-plugin@^7.12.17":
version "7.12.17" version "7.12.17"
resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.12.17.tgz#704b69c8a78d03fb1c5fcc2e7b593f8a65628944" resolved "https://registry.yarnpkg.com/@babel/helper-create-className-features-plugin/-/helper-create-className-features-plugin-7.12.17.tgz#704b69c8a78d03fb1c5fcc2e7b593f8a65628944"
integrity sha512-I/nurmTxIxHV0M+rIpfQBF1oN342+yvl2kwZUrQuOClMamHF1w5tknfZubgNOLRoA73SzBFAdFcpb4M9HwOeWQ== integrity sha512-I/nurmTxIxHV0M+rIpfQBF1oN342+yvl2kwZUrQuOClMamHF1w5tknfZubgNOLRoA73SzBFAdFcpb4M9HwOeWQ==
dependencies: dependencies:
"@babel/helper-function-name" "^7.12.13" "@babel/helper-function-name" "^7.12.13"
...@@ -287,20 +287,20 @@ ...@@ -287,20 +287,20 @@
"@babel/helper-remap-async-to-generator" "^7.12.13" "@babel/helper-remap-async-to-generator" "^7.12.13"
"@babel/plugin-syntax-async-generators" "^7.8.0" "@babel/plugin-syntax-async-generators" "^7.8.0"
"@babel/plugin-proposal-class-properties@7.12.1": "@babel/plugin-proposal-className-properties@7.12.1":
version "7.12.1" version "7.12.1"
resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.12.1.tgz#a082ff541f2a29a4821065b8add9346c0c16e5de" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-className-properties/-/plugin-proposal-className-properties-7.12.1.tgz#a082ff541f2a29a4821065b8add9346c0c16e5de"
integrity sha512-cKp3dlQsFsEs5CWKnN7BnSHOd0EOW8EKpEjkoz1pO2E5KzIDNV9Ros1b0CnmbVgAGXJubOYVBOGCT1OmJwOI7w== integrity sha512-cKp3dlQsFsEs5CWKnN7BnSHOd0EOW8EKpEjkoz1pO2E5KzIDNV9Ros1b0CnmbVgAGXJubOYVBOGCT1OmJwOI7w==
dependencies: dependencies:
"@babel/helper-create-class-features-plugin" "^7.12.1" "@babel/helper-create-className-features-plugin" "^7.12.1"
"@babel/helper-plugin-utils" "^7.10.4" "@babel/helper-plugin-utils" "^7.10.4"
"@babel/plugin-proposal-class-properties@^7.12.1", "@babel/plugin-proposal-class-properties@^7.12.13": "@babel/plugin-proposal-className-properties@^7.12.1", "@babel/plugin-proposal-className-properties@^7.12.13":
version "7.12.13" version "7.12.13"
resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.12.13.tgz#3d2ce350367058033c93c098e348161d6dc0d8c8" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-className-properties/-/plugin-proposal-className-properties-7.12.13.tgz#3d2ce350367058033c93c098e348161d6dc0d8c8"
integrity sha512-8SCJ0Ddrpwv4T7Gwb33EmW1V9PY5lggTO+A8WjyIwxrSHDUyBw4MtF96ifn1n8H806YlxbVCoKXbbmzD6RD+cA== integrity sha512-8SCJ0Ddrpwv4T7Gwb33EmW1V9PY5lggTO+A8WjyIwxrSHDUyBw4MtF96ifn1n8H806YlxbVCoKXbbmzD6RD+cA==
dependencies: dependencies:
"@babel/helper-create-class-features-plugin" "^7.12.13" "@babel/helper-create-className-features-plugin" "^7.12.13"
"@babel/helper-plugin-utils" "^7.12.13" "@babel/helper-plugin-utils" "^7.12.13"
"@babel/plugin-proposal-decorators@7.12.1": "@babel/plugin-proposal-decorators@7.12.1":
...@@ -308,7 +308,7 @@ ...@@ -308,7 +308,7 @@
resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.12.1.tgz#59271439fed4145456c41067450543aee332d15f" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.12.1.tgz#59271439fed4145456c41067450543aee332d15f"
integrity sha512-knNIuusychgYN8fGJHONL0RbFxLGawhXOJNLBk75TniTsZZeA+wdkDuv6wp4lGwzQEKjZi6/WYtnb3udNPmQmQ== integrity sha512-knNIuusychgYN8fGJHONL0RbFxLGawhXOJNLBk75TniTsZZeA+wdkDuv6wp4lGwzQEKjZi6/WYtnb3udNPmQmQ==
dependencies: dependencies:
"@babel/helper-create-class-features-plugin" "^7.12.1" "@babel/helper-create-className-features-plugin" "^7.12.1"
"@babel/helper-plugin-utils" "^7.10.4" "@babel/helper-plugin-utils" "^7.10.4"
"@babel/plugin-syntax-decorators" "^7.12.1" "@babel/plugin-syntax-decorators" "^7.12.1"
...@@ -416,7 +416,7 @@ ...@@ -416,7 +416,7 @@
resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.12.13.tgz#ea78a12554d784ecf7fc55950b752d469d9c4a71" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.12.13.tgz#ea78a12554d784ecf7fc55950b752d469d9c4a71"
integrity sha512-sV0V57uUwpauixvR7s2o75LmwJI6JECwm5oPUY5beZB1nBl2i37hc7CJGqB5G+58fur5Y6ugvl3LRONk5x34rg== integrity sha512-sV0V57uUwpauixvR7s2o75LmwJI6JECwm5oPUY5beZB1nBl2i37hc7CJGqB5G+58fur5Y6ugvl3LRONk5x34rg==
dependencies: dependencies:
"@babel/helper-create-class-features-plugin" "^7.12.13" "@babel/helper-create-className-features-plugin" "^7.12.13"
"@babel/helper-plugin-utils" "^7.12.13" "@babel/helper-plugin-utils" "^7.12.13"
"@babel/plugin-proposal-unicode-property-regex@^7.12.1", "@babel/plugin-proposal-unicode-property-regex@^7.12.13", "@babel/plugin-proposal-unicode-property-regex@^7.4.4": "@babel/plugin-proposal-unicode-property-regex@^7.12.1", "@babel/plugin-proposal-unicode-property-regex@^7.12.13", "@babel/plugin-proposal-unicode-property-regex@^7.4.4":
...@@ -441,9 +441,9 @@ ...@@ -441,9 +441,9 @@
dependencies: dependencies:
"@babel/helper-plugin-utils" "^7.8.0" "@babel/helper-plugin-utils" "^7.8.0"
"@babel/plugin-syntax-class-properties@^7.12.1", "@babel/plugin-syntax-class-properties@^7.12.13", "@babel/plugin-syntax-class-properties@^7.8.3": "@babel/plugin-syntax-className-properties@^7.12.1", "@babel/plugin-syntax-className-properties@^7.12.13", "@babel/plugin-syntax-className-properties@^7.8.3":
version "7.12.13" version "7.12.13"
resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz#b5c987274c4a3a82b89714796931a6b53544ae10" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-className-properties/-/plugin-syntax-className-properties-7.12.13.tgz#b5c987274c4a3a82b89714796931a6b53544ae10"
integrity sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA== integrity sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==
dependencies: dependencies:
"@babel/helper-plugin-utils" "^7.12.13" "@babel/helper-plugin-utils" "^7.12.13"
...@@ -583,9 +583,9 @@ ...@@ -583,9 +583,9 @@
dependencies: dependencies:
"@babel/helper-plugin-utils" "^7.12.13" "@babel/helper-plugin-utils" "^7.12.13"
"@babel/plugin-transform-classes@^7.12.1", "@babel/plugin-transform-classes@^7.12.13": "@babel/plugin-transform-classNamees@^7.12.1", "@babel/plugin-transform-classNamees@^7.12.13":
version "7.12.13" version "7.12.13"
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.12.13.tgz#9728edc1838b5d62fc93ad830bd523b1fcb0e1f6" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classNamees/-/plugin-transform-classNamees-7.12.13.tgz#9728edc1838b5d62fc93ad830bd523b1fcb0e1f6"
integrity sha512-cqZlMlhCC1rVnxE5ZGMtIb896ijL90xppMiuWXcwcOAuFczynpd3KYemb91XFFPi3wJSe/OcrX9lXoowatkkxA== integrity sha512-cqZlMlhCC1rVnxE5ZGMtIb896ijL90xppMiuWXcwcOAuFczynpd3KYemb91XFFPi3wJSe/OcrX9lXoowatkkxA==
dependencies: dependencies:
"@babel/helper-annotate-as-pure" "^7.12.13" "@babel/helper-annotate-as-pure" "^7.12.13"
...@@ -870,7 +870,7 @@ ...@@ -870,7 +870,7 @@
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.12.17.tgz#4aa6a5041888dd2e5d316ec39212b0cf855211bb" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.12.17.tgz#4aa6a5041888dd2e5d316ec39212b0cf855211bb"
integrity sha512-1bIYwnhRoetxkFonuZRtDZPFEjl1l5r+3ITkxLC3mlMaFja+GQFo94b/WHEPjqWLU9Bc+W4oFZbvCGe9eYMu1g== integrity sha512-1bIYwnhRoetxkFonuZRtDZPFEjl1l5r+3ITkxLC3mlMaFja+GQFo94b/WHEPjqWLU9Bc+W4oFZbvCGe9eYMu1g==
dependencies: dependencies:
"@babel/helper-create-class-features-plugin" "^7.12.17" "@babel/helper-create-className-features-plugin" "^7.12.17"
"@babel/helper-plugin-utils" "^7.12.13" "@babel/helper-plugin-utils" "^7.12.13"
"@babel/plugin-syntax-typescript" "^7.12.13" "@babel/plugin-syntax-typescript" "^7.12.13"
...@@ -900,7 +900,7 @@ ...@@ -900,7 +900,7 @@
"@babel/helper-plugin-utils" "^7.10.4" "@babel/helper-plugin-utils" "^7.10.4"
"@babel/helper-validator-option" "^7.12.1" "@babel/helper-validator-option" "^7.12.1"
"@babel/plugin-proposal-async-generator-functions" "^7.12.1" "@babel/plugin-proposal-async-generator-functions" "^7.12.1"
"@babel/plugin-proposal-class-properties" "^7.12.1" "@babel/plugin-proposal-className-properties" "^7.12.1"
"@babel/plugin-proposal-dynamic-import" "^7.12.1" "@babel/plugin-proposal-dynamic-import" "^7.12.1"
"@babel/plugin-proposal-export-namespace-from" "^7.12.1" "@babel/plugin-proposal-export-namespace-from" "^7.12.1"
"@babel/plugin-proposal-json-strings" "^7.12.1" "@babel/plugin-proposal-json-strings" "^7.12.1"
...@@ -913,7 +913,7 @@ ...@@ -913,7 +913,7 @@
"@babel/plugin-proposal-private-methods" "^7.12.1" "@babel/plugin-proposal-private-methods" "^7.12.1"
"@babel/plugin-proposal-unicode-property-regex" "^7.12.1" "@babel/plugin-proposal-unicode-property-regex" "^7.12.1"
"@babel/plugin-syntax-async-generators" "^7.8.0" "@babel/plugin-syntax-async-generators" "^7.8.0"
"@babel/plugin-syntax-class-properties" "^7.12.1" "@babel/plugin-syntax-className-properties" "^7.12.1"
"@babel/plugin-syntax-dynamic-import" "^7.8.0" "@babel/plugin-syntax-dynamic-import" "^7.8.0"
"@babel/plugin-syntax-export-namespace-from" "^7.8.3" "@babel/plugin-syntax-export-namespace-from" "^7.8.3"
"@babel/plugin-syntax-json-strings" "^7.8.0" "@babel/plugin-syntax-json-strings" "^7.8.0"
...@@ -928,7 +928,7 @@ ...@@ -928,7 +928,7 @@
"@babel/plugin-transform-async-to-generator" "^7.12.1" "@babel/plugin-transform-async-to-generator" "^7.12.1"
"@babel/plugin-transform-block-scoped-functions" "^7.12.1" "@babel/plugin-transform-block-scoped-functions" "^7.12.1"
"@babel/plugin-transform-block-scoping" "^7.12.1" "@babel/plugin-transform-block-scoping" "^7.12.1"
"@babel/plugin-transform-classes" "^7.12.1" "@babel/plugin-transform-classNamees" "^7.12.1"
"@babel/plugin-transform-computed-properties" "^7.12.1" "@babel/plugin-transform-computed-properties" "^7.12.1"
"@babel/plugin-transform-destructuring" "^7.12.1" "@babel/plugin-transform-destructuring" "^7.12.1"
"@babel/plugin-transform-dotall-regex" "^7.12.1" "@babel/plugin-transform-dotall-regex" "^7.12.1"
...@@ -972,7 +972,7 @@ ...@@ -972,7 +972,7 @@
"@babel/helper-plugin-utils" "^7.12.13" "@babel/helper-plugin-utils" "^7.12.13"
"@babel/helper-validator-option" "^7.12.17" "@babel/helper-validator-option" "^7.12.17"
"@babel/plugin-proposal-async-generator-functions" "^7.12.13" "@babel/plugin-proposal-async-generator-functions" "^7.12.13"
"@babel/plugin-proposal-class-properties" "^7.12.13" "@babel/plugin-proposal-className-properties" "^7.12.13"
"@babel/plugin-proposal-dynamic-import" "^7.12.17" "@babel/plugin-proposal-dynamic-import" "^7.12.17"
"@babel/plugin-proposal-export-namespace-from" "^7.12.13" "@babel/plugin-proposal-export-namespace-from" "^7.12.13"
"@babel/plugin-proposal-json-strings" "^7.12.13" "@babel/plugin-proposal-json-strings" "^7.12.13"
...@@ -985,7 +985,7 @@ ...@@ -985,7 +985,7 @@
"@babel/plugin-proposal-private-methods" "^7.12.13" "@babel/plugin-proposal-private-methods" "^7.12.13"
"@babel/plugin-proposal-unicode-property-regex" "^7.12.13" "@babel/plugin-proposal-unicode-property-regex" "^7.12.13"
"@babel/plugin-syntax-async-generators" "^7.8.0" "@babel/plugin-syntax-async-generators" "^7.8.0"
"@babel/plugin-syntax-class-properties" "^7.12.13" "@babel/plugin-syntax-className-properties" "^7.12.13"
"@babel/plugin-syntax-dynamic-import" "^7.8.0" "@babel/plugin-syntax-dynamic-import" "^7.8.0"
"@babel/plugin-syntax-export-namespace-from" "^7.8.3" "@babel/plugin-syntax-export-namespace-from" "^7.8.3"
"@babel/plugin-syntax-json-strings" "^7.8.0" "@babel/plugin-syntax-json-strings" "^7.8.0"
...@@ -1000,7 +1000,7 @@ ...@@ -1000,7 +1000,7 @@
"@babel/plugin-transform-async-to-generator" "^7.12.13" "@babel/plugin-transform-async-to-generator" "^7.12.13"
"@babel/plugin-transform-block-scoped-functions" "^7.12.13" "@babel/plugin-transform-block-scoped-functions" "^7.12.13"
"@babel/plugin-transform-block-scoping" "^7.12.13" "@babel/plugin-transform-block-scoping" "^7.12.13"
"@babel/plugin-transform-classes" "^7.12.13" "@babel/plugin-transform-classNamees" "^7.12.13"
"@babel/plugin-transform-computed-properties" "^7.12.13" "@babel/plugin-transform-computed-properties" "^7.12.13"
"@babel/plugin-transform-destructuring" "^7.12.13" "@babel/plugin-transform-destructuring" "^7.12.13"
"@babel/plugin-transform-dotall-regex" "^7.12.13" "@babel/plugin-transform-dotall-regex" "^7.12.13"
...@@ -2610,7 +2610,7 @@ babel-preset-current-node-syntax@^1.0.0: ...@@ -2610,7 +2610,7 @@ babel-preset-current-node-syntax@^1.0.0:
dependencies: dependencies:
"@babel/plugin-syntax-async-generators" "^7.8.4" "@babel/plugin-syntax-async-generators" "^7.8.4"
"@babel/plugin-syntax-bigint" "^7.8.3" "@babel/plugin-syntax-bigint" "^7.8.3"
"@babel/plugin-syntax-class-properties" "^7.8.3" "@babel/plugin-syntax-className-properties" "^7.8.3"
"@babel/plugin-syntax-import-meta" "^7.8.3" "@babel/plugin-syntax-import-meta" "^7.8.3"
"@babel/plugin-syntax-json-strings" "^7.8.3" "@babel/plugin-syntax-json-strings" "^7.8.3"
"@babel/plugin-syntax-logical-assignment-operators" "^7.8.3" "@babel/plugin-syntax-logical-assignment-operators" "^7.8.3"
...@@ -2635,7 +2635,7 @@ babel-preset-react-app@^10.0.0: ...@@ -2635,7 +2635,7 @@ babel-preset-react-app@^10.0.0:
integrity sha512-itL2z8v16khpuKutx5IH8UdCdSTuzrOhRFTEdIhveZ2i1iBKDrVE0ATa4sFVy+02GLucZNVBWtoarXBy0Msdpg== integrity sha512-itL2z8v16khpuKutx5IH8UdCdSTuzrOhRFTEdIhveZ2i1iBKDrVE0ATa4sFVy+02GLucZNVBWtoarXBy0Msdpg==
dependencies: dependencies:
"@babel/core" "7.12.3" "@babel/core" "7.12.3"
"@babel/plugin-proposal-class-properties" "7.12.1" "@babel/plugin-proposal-className-properties" "7.12.1"
"@babel/plugin-proposal-decorators" "7.12.1" "@babel/plugin-proposal-decorators" "7.12.1"
"@babel/plugin-proposal-nullish-coalescing-operator" "7.12.1" "@babel/plugin-proposal-nullish-coalescing-operator" "7.12.1"
"@babel/plugin-proposal-numeric-separator" "7.12.1" "@babel/plugin-proposal-numeric-separator" "7.12.1"
...@@ -2679,7 +2679,7 @@ base@^0.11.1: ...@@ -2679,7 +2679,7 @@ base@^0.11.1:
integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg== integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==
dependencies: dependencies:
cache-base "^1.0.1" cache-base "^1.0.1"
class-utils "^0.3.5" className-utils "^0.3.5"
component-emitter "^1.2.1" component-emitter "^1.2.1"
define-property "^1.0.0" define-property "^1.0.0"
isobject "^3.0.1" isobject "^3.0.1"
...@@ -3205,9 +3205,9 @@ cjs-module-lexer@^0.6.0: ...@@ -3205,9 +3205,9 @@ cjs-module-lexer@^0.6.0:
resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-0.6.0.tgz#4186fcca0eae175970aee870b9fe2d6cf8d5655f" resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-0.6.0.tgz#4186fcca0eae175970aee870b9fe2d6cf8d5655f"
integrity sha512-uc2Vix1frTfnuzxxu1Hp4ktSvM3QaI4oXl4ZUqL1wjTu/BGki9TrCWoqLTg/drR1KwAEarXuRFCG2Svr1GxPFw== integrity sha512-uc2Vix1frTfnuzxxu1Hp4ktSvM3QaI4oXl4ZUqL1wjTu/BGki9TrCWoqLTg/drR1KwAEarXuRFCG2Svr1GxPFw==
class-utils@^0.3.5: className-utils@^0.3.5:
version "0.3.6" version "0.3.6"
resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" resolved "https://registry.yarnpkg.com/className-utils/-/className-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463"
integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg== integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==
dependencies: dependencies:
arr-union "^3.1.0" arr-union "^3.1.0"
...@@ -4716,7 +4716,7 @@ expand-brackets@^2.1.4: ...@@ -4716,7 +4716,7 @@ expand-brackets@^2.1.4:
debug "^2.3.3" debug "^2.3.3"
define-property "^0.2.5" define-property "^0.2.5"
extend-shallow "^2.0.1" extend-shallow "^2.0.1"
posix-character-classes "^0.1.0" posix-character-classNamees "^0.1.0"
regex-not "^1.0.0" regex-not "^1.0.0"
snapdragon "^0.8.1" snapdragon "^0.8.1"
to-regex "^3.0.1" to-regex "^3.0.1"
...@@ -7991,9 +7991,9 @@ portfinder@^1.0.26: ...@@ -7991,9 +7991,9 @@ portfinder@^1.0.26:
debug "^3.1.1" debug "^3.1.1"
mkdirp "^0.5.5" mkdirp "^0.5.5"
posix-character-classes@^0.1.0: posix-character-classNamees@^0.1.0:
version "0.1.1" version "0.1.1"
resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" resolved "https://registry.yarnpkg.com/posix-character-classNamees/-/posix-character-classNamees-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab"
integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs= integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=
postcss-attribute-case-insensitive@^4.0.1: postcss-attribute-case-insensitive@^4.0.1:
...@@ -8104,9 +8104,9 @@ postcss-custom-selectors@^5.1.2: ...@@ -8104,9 +8104,9 @@ postcss-custom-selectors@^5.1.2:
postcss "^7.0.2" postcss "^7.0.2"
postcss-selector-parser "^5.0.0-rc.3" postcss-selector-parser "^5.0.0-rc.3"
postcss-dir-pseudo-class@^5.0.0: postcss-dir-pseudo-className@^5.0.0:
version "5.0.0" version "5.0.0"
resolved "https://registry.yarnpkg.com/postcss-dir-pseudo-class/-/postcss-dir-pseudo-class-5.0.0.tgz#6e3a4177d0edb3abcc85fdb6fbb1c26dabaeaba2" resolved "https://registry.yarnpkg.com/postcss-dir-pseudo-className/-/postcss-dir-pseudo-className-5.0.0.tgz#6e3a4177d0edb3abcc85fdb6fbb1c26dabaeaba2"
integrity sha512-3pm4oq8HYWMZePJY+5ANriPs3P07q+LW6FAdTlkFH2XqDdP4HeeJYMOzn0HYLhRSjBO3fhiqSwwU9xEULSrPgw== integrity sha512-3pm4oq8HYWMZePJY+5ANriPs3P07q+LW6FAdTlkFH2XqDdP4HeeJYMOzn0HYLhRSjBO3fhiqSwwU9xEULSrPgw==
dependencies: dependencies:
postcss "^7.0.2" postcss "^7.0.2"
...@@ -8495,7 +8495,7 @@ postcss-preset-env@6.7.0: ...@@ -8495,7 +8495,7 @@ postcss-preset-env@6.7.0:
postcss-custom-media "^7.0.8" postcss-custom-media "^7.0.8"
postcss-custom-properties "^8.0.11" postcss-custom-properties "^8.0.11"
postcss-custom-selectors "^5.1.2" postcss-custom-selectors "^5.1.2"
postcss-dir-pseudo-class "^5.0.0" postcss-dir-pseudo-className "^5.0.0"
postcss-double-position-gradients "^1.0.0" postcss-double-position-gradients "^1.0.0"
postcss-env-function "^2.0.2" postcss-env-function "^2.0.2"
postcss-focus-visible "^4.0.0" postcss-focus-visible "^4.0.0"
...@@ -8511,14 +8511,14 @@ postcss-preset-env@6.7.0: ...@@ -8511,14 +8511,14 @@ postcss-preset-env@6.7.0:
postcss-overflow-shorthand "^2.0.0" postcss-overflow-shorthand "^2.0.0"
postcss-page-break "^2.0.0" postcss-page-break "^2.0.0"
postcss-place "^4.0.1" postcss-place "^4.0.1"
postcss-pseudo-class-any-link "^6.0.0" postcss-pseudo-className-any-link "^6.0.0"
postcss-replace-overflow-wrap "^3.0.0" postcss-replace-overflow-wrap "^3.0.0"
postcss-selector-matches "^4.0.0" postcss-selector-matches "^4.0.0"
postcss-selector-not "^4.0.0" postcss-selector-not "^4.0.0"
postcss-pseudo-class-any-link@^6.0.0: postcss-pseudo-className-any-link@^6.0.0:
version "6.0.0" version "6.0.0"
resolved "https://registry.yarnpkg.com/postcss-pseudo-class-any-link/-/postcss-pseudo-class-any-link-6.0.0.tgz#2ed3eed393b3702879dec4a87032b210daeb04d1" resolved "https://registry.yarnpkg.com/postcss-pseudo-className-any-link/-/postcss-pseudo-className-any-link-6.0.0.tgz#2ed3eed393b3702879dec4a87032b210daeb04d1"
integrity sha512-lgXW9sYJdLqtmw23otOzrtbDXofUdfYzNm4PIpNE322/swES3VU9XlXHeJS46zT2onFO7V1QFdD4Q9LiZj8mew== integrity sha512-lgXW9sYJdLqtmw23otOzrtbDXofUdfYzNm4PIpNE322/swES3VU9XlXHeJS46zT2onFO7V1QFdD4Q9LiZj8mew==
dependencies: dependencies:
postcss "^7.0.2" postcss "^7.0.2"
......
import { User } from '../models/index.js' import { User } from "../models/index.js";
import jwt from 'jsonwebtoken' import jwt from "jsonwebtoken";
import config from '../config/app.config.js' import config from "../config/app.config.js";
import isLength from 'validator/lib/isLength.js' import isLength from "validator/lib/isLength.js";
import bcrypt from "bcryptjs";
const multer = require("multer");
const uploadimg = multer({ dest: "uploads/" });
const imgUpload = uploadimg.fields([{ name: "img", maxCount: 1 }]);
const update = async (req, res) => {
try {
console.log("id:", req.body.id);
const id = req.body.id;
const avatar = req.files["img"][0];
const img = avatar.filename;
console.log(img);
await User.update({ img: img }, { where: { id: id } });
res.json(img);
} catch (error) {
console.log(error);
res.status(500).send("이미지 업데이트 실패");
}
};
const getUser = async (req, res) => { const getUser = async (req, res) => {
const user = await User.findOne({ where: { id: req.body.id } }); const user = await User.findOne({ where: { id: req.body.id } });
res.json(user) res.json(user)
}; };
const updateinfo = async (req, res) => {
console.log(req.body);
const { id, name, email, phone, img } = req.body;
console.log("id:", id);
const A = {
name: name,
email: email,
phone: phone,
img: img,
};
await User.update(A, { where: { id: id } });
const user = await User.findOne({ where: { id: id } });
console.log('user:',user)
};
const login = async (req, res) => { const login = async (req, res) => {
try { try {
console.log('login= ', req.body) console.log("login= ", req.body);
const { email, password } = req.body const { email, password } = req.body;
const user = await User.findOne({ where: { email: email } }) const user = await User.findOne({ where: { email: email } });
if (!user) { if (!user) {
return res.status(422).send(`${email} 사용자가 존재하지 않습니다.`) return res.status(422).send(`${email} 사용자가 존재하지 않습니다.`);
} else { } else {
const passworMatch = await user.comparePassword(password) const passworMatch = await user.comparePassword(password);
if (passworMatch) { if (passworMatch) {
const token = jwt.sign({ userID: user.id }, config.jwtSecret, { const token = jwt.sign({ userID: user.id }, config.jwtSecret, {
expiresIn: config.jwtExpires, expiresIn: config.jwtExpires,
}) });
res.cookie(config.cookieName, token, { res.cookie(config.cookieName, token, {
path: '/', path: "/",
httpOnly: true, httpOnly: true,
secure: true, secure: true,
}) });
res.json(user) res.json(user);
} else { } else {
res.status(401).send('비밀번호가 일치하지 않습니다.') res.status(401).send("비밀번호가 일치하지 않습니다.");
} }
} }
} catch (error) { } catch (error) {
console.log(error) console.log(error);
return res.status(500).send('로그인 중 에러') return res.status(500).send("로그인 중 에러");
} }
} };
const signup = async (req, res) => { const signup = async (req, res) => {
try { try {
console.log('sign up= ', req.body) console.log("sign up= ", req.body);
const { name, email, password, gender, phone } = req.body const { name, email, password, gender, phone } = req.body;
const id = Math.floor(Math.random() * (9999 - 1000) + 1000) const id = Math.floor(Math.random() * (9999 - 1000) + 1000);
console.log('id:', id) console.log("id:", id);
const Id = await User.findOne({ where: { id: id } }) const Id = await User.findOne({ where: { id: id } });
console.log('Id 중복확인:', Id) console.log("Id 중복확인:", Id);
while (Id) { while (Id) {
const id = Math.floor(Math.random() * (9999 - 1000) + 1000) const id = Math.floor(Math.random() * (9999 - 1000) + 1000);
const Id = await User.findOne({ where: { id: id } }) const Id = await User.findOne({ where: { id: id } });
} }
const user = await User.findOne({ where: { email: email } }) const user = await User.findOne({ where: { email: email } });
if (user) if (user)
return res.status(422).send(`${email} 이미 존재하는 사용자입니다.`) return res.status(422).send(`${email} 이미 존재하는 사용자입니다.`);
if (!isLength(name, { min: 3, max: 10 })) { if (!isLength(name, { min: 3, max: 10 })) {
return res.status(422).send('이름은 3-10자 사이입니다') return res.status(422).send("이름은 3-10자 사이입니다");
} else if (!isLength(password, { min: 6 })) { } else if (!isLength(password, { min: 6 })) {
return res.status(422).send('비밀번호는 6자이상 입니다') return res.status(422).send("비밀번호는 6자이상 입니다");
} else if (!isLength(email, { min: 3, max: 10 })) { } else if (!isLength(email, { min: 3, max: 10 })) {
return res.status(422).send('아이디는 3-10자 사이입니다') return res.status(422).send("아이디는 3-10자 사이입니다");
} }
const newUser = await User.create({ const newUser = await User.create({
id: id, id: id,
...@@ -69,23 +101,26 @@ const signup = async (req, res) => { ...@@ -69,23 +101,26 @@ const signup = async (req, res) => {
password: password, password: password,
gender: gender, gender: gender,
phone: phone, phone: phone,
}).then(_ => }).then((_) =>
console.log('회원가입 정보', id, name, email, password, gender, phone), console.log("회원가입 정보", id, name, email, password, gender, phone)
) );
} catch (error) { } catch (error) {
console.log(error) console.log(error);
return res.status(500).send('회원가입 중 에러') return res.status(500).send("회원가입 중 에러");
} }
} };
const logout = (req, res) => { const logout = (req, res) => {
res.clearCookie('token') res.clearCookie("token");
res.send('Logout Successful') res.send("Logout Successful");
} };
export default { export default {
getUser, getUser,
login, login,
signup, signup,
logout, logout,
} imgUpload,
update,
updateinfo,
};
import bcrypt from "bcryptjs"; import bcrypt from "bcryptjs";
import { DataTypes } from "sequelize"; import { DataTypes } from "sequelize";
// import img from 'bora_it\client\public\user.png'
const UserModel = (sequelize) => { const UserModel = (sequelize) => {
const User = sequelize.define( const User = sequelize.define(
...@@ -26,7 +27,7 @@ const UserModel = (sequelize) => { ...@@ -26,7 +27,7 @@ const UserModel = (sequelize) => {
}, },
img: { img: {
type: DataTypes.STRING, type: DataTypes.STRING,
defaultValue: "/user.png" // defaultValue: img
}, },
roomNumber: { roomNumber: {
type: DataTypes.ARRAY(DataTypes.STRING), type: DataTypes.ARRAY(DataTypes.STRING),
......
...@@ -9,7 +9,11 @@ ...@@ -9,7 +9,11 @@
"build": "tsc -p ." "build": "tsc -p ."
}, },
"nodemonConfig": { "nodemonConfig": {
"ignore": ["test/*", "docs/*", "client/*"] "ignore": [
"test/*",
"docs/*",
"client/*"
]
}, },
"repository": { "repository": {
"type": "git", "type": "git",
...@@ -27,6 +31,7 @@ ...@@ -27,6 +31,7 @@
"express": "4.17.1", "express": "4.17.1",
"http": "0.0.1-security", "http": "0.0.1-security",
"jsonwebtoken": "^8.5.1", "jsonwebtoken": "^8.5.1",
"multer": "^1.4.2",
"nanoid": "^3.1.23", "nanoid": "^3.1.23",
"nodemon": "^2.0.7", "nodemon": "^2.0.7",
"pg": "^8.6.0", "pg": "^8.6.0",
......
...@@ -7,4 +7,10 @@ router.route("/getUser").get(userCtrl.getUser); ...@@ -7,4 +7,10 @@ router.route("/getUser").get(userCtrl.getUser);
router.route("/login").post(userCtrl.login); router.route("/login").post(userCtrl.login);
router.route("/signup").post(userCtrl.signup); router.route("/signup").post(userCtrl.signup);
router.route("/profileimg")
.put(userCtrl.imgUpload, userCtrl.update)
router.route("/updateinfo")
.put(userCtrl.updateinfo)
router.route("/").post(userCtrl.signup);
export default router; export default router;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment