Switched to local MongoDB

This commit is contained in:
Malak
2024-08-18 14:43:18 +03:00
committed by QkoSad
parent 78ba14cc98
commit 8e83b6b8df
8 changed files with 40 additions and 26 deletions
+1
View File
@@ -1 +1,2 @@
node_modules node_modules
App.css
+14 -5
View File
@@ -1,7 +1,16 @@
a { .datePicker :hover {
text-decoration: none; border-color: "#212121";
color: darkorange;
} }
body { .datePicker :focus {
background-color: whitesmoke; border-color: "#1976d2";
border-width: "2px";
}
.datePicker{
color:"red";
background:"red";
}
.colormebaby{
background-color:"red";
color:"red"
} }
+6
View File
@@ -0,0 +1,6 @@
1. When creating profile in the Profile form need to be added validation for the
email because if the email is not email it gets sent to the server and crashes
Fix all the form data apis, formData
Extract the inpudate component from addeducation
maybe fix that addeducation
+1
View File
@@ -2,6 +2,7 @@ import React from "react";
import ReactDOM from "react-dom/client"; import ReactDOM from "react-dom/client";
import App from "./App"; import App from "./App";
import "./App2.css";
const root = ReactDOM.createRoot( const root = ReactDOM.createRoot(
document.getElementById("root") as HTMLElement, document.getElementById("root") as HTMLElement,
); );
-1
View File
@@ -13,7 +13,6 @@ function auth(req: ResponseAndUser, res: Response, next: NextFunction) {
return res.status(401).json({ msg: 'No token, authorization denied' }); return res.status(401).json({ msg: 'No token, authorization denied' });
} }
console.log('auth middlewarwe')
// Verify token // Verify token
try { try {
jwt.verify(token, config.get('jwtSecret'), (error, decoded) => { jwt.verify(token, config.get('jwtSecret'), (error, decoded) => {
+6 -6
View File
@@ -1011,9 +1011,9 @@
} }
}, },
"node_modules/is-core-module": { "node_modules/is-core-module": {
"version": "2.12.1", "version": "2.13.0",
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.1.tgz", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.0.tgz",
"integrity": "sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg==", "integrity": "sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==",
"dependencies": { "dependencies": {
"has": "^1.0.3" "has": "^1.0.3"
}, },
@@ -2902,9 +2902,9 @@
} }
}, },
"is-core-module": { "is-core-module": {
"version": "2.12.1", "version": "2.13.0",
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.1.tgz", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.0.tgz",
"integrity": "sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg==", "integrity": "sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==",
"requires": { "requires": {
"has": "^1.0.3" "has": "^1.0.3"
} }
-1
View File
@@ -17,7 +17,6 @@ const router = express.Router();
router.get("/", auth, async (req: any, res) => { router.get("/", auth, async (req: any, res) => {
try { try {
let user: unknown = null let user: unknown = null
console.log(req.user)
if (isUserId(req)) { if (isUserId(req)) {
user = await User.findById(req.user.id).select("-password"); user = await User.findById(req.user.id).select("-password");
res.json(user); res.json(user);
Executable → Regular
+12 -13
View File
@@ -1,26 +1,25 @@
import express from 'express' import express from "express";
import connectDB from './config/db' import connectDB from "./config/db";
import path from 'path' import path from "path";
const app = express(); const app = express();
connectDB(); connectDB();
app.use(express.json()); app.use(express.json());
app.use("/api/users", require("./routers/api/users"));
app.use('/api/users', require('./routers/api/users')) app.use("/api/auth", require("./routers/api/auth"));
app.use('/api/auth', require('./routers/api/auth')) app.use("/api/profile", require("./routers/api/profile"));
app.use('/api/profile', require('./routers/api/profile')) app.use("/api/posts", require("./routers/api/posts"));
app.use('/api/posts', require('./routers/api/posts'))
// Serve static assets in production // Serve static assets in production
if (process.env.NODE_ENV === 'production') { if (process.env.NODE_ENV === "production") {
app.use(express.static('client/build')); app.use(express.static("client/build"));
app.get('*', (req, res) => [ app.get("*", (req, res) => [
res.sendFile(path.resolve(__dirname, 'client', 'build', 'index.html')) res.sendFile(path.resolve(__dirname, "client", "build", "index.html")),
]) ]);
} }
const PORT = process.env.PORT || 5000; const PORT = process.env.PORT || 5000;