no idea what i did
This commit is contained in:
@@ -2,3 +2,5 @@ node_modules
|
|||||||
start_in_tmux.sh
|
start_in_tmux.sh
|
||||||
default.json
|
default.json
|
||||||
production.json
|
production.json
|
||||||
|
bin
|
||||||
|
obj
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import React from "react";
|
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import { logOut } from "../../reducers/auth";
|
import { logOut } from "../../reducers/auth";
|
||||||
import { useAppDispatch, useAppSelector } from "../../utils/hooks";
|
import { useAppDispatch, useAppSelector } from "../../utils/hooks";
|
||||||
@@ -69,7 +68,7 @@ const Navbar = () => {
|
|||||||
<AppBar position="static">
|
<AppBar position="static">
|
||||||
<Container maxWidth="xl">
|
<Container maxWidth="xl">
|
||||||
<Toolbar disableGutters>
|
<Toolbar disableGutters>
|
||||||
{/*Icon for big dislay*/}
|
{/*Icon for big display*/}
|
||||||
<AdbIcon sx={{ display: { xs: "none", md: "flex" }, mr: 1 }} />
|
<AdbIcon sx={{ display: { xs: "none", md: "flex" }, mr: 1 }} />
|
||||||
{/*LOGO link for bi display*/}
|
{/*LOGO link for bi display*/}
|
||||||
<Typography
|
<Typography
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Box, Button, Container, TextField, Typography } from "@mui/material";
|
{ Box, Button, Container, TextField, Typography } from "@mui/material";
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { createAlert } from "../../actions/alert";
|
import { createAlert } from "../../actions/alert";
|
||||||
import { addPost } from "../../actions/post";
|
import { addPost } from "../../actions/post";
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ const ProfileForm = () => {
|
|||||||
// then build our profileData
|
// then build our profileData
|
||||||
if (!loading && profile) {
|
if (!loading && profile) {
|
||||||
const profileData: any = { ...initialState };
|
const profileData: any = { ...initialState };
|
||||||
// cant figure out how to type key to be keyof profile so they are any now
|
// can't figure out how to type key to be keyof profile so they are any now
|
||||||
for (const key in profile) {
|
for (const key in profile) {
|
||||||
if (key in profileData) profileData[key] = profile[key];
|
if (key in profileData) profileData[key] = profile[key];
|
||||||
}
|
}
|
||||||
@@ -215,7 +215,7 @@ const ProfileForm = () => {
|
|||||||
</Grid>
|
</Grid>
|
||||||
<Grid size={{ xs: 6 }}>
|
<Grid size={{ xs: 6 }}>
|
||||||
<Typography>
|
<Typography>
|
||||||
Please use comma separeted values (eg. HTML, CSS, JavaScript, PHP)
|
Please use comma separated values (eg. HTML, CSS, JavaScript, PHP)
|
||||||
</Typography>
|
</Typography>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid size={{ xs: 6 }}>
|
<Grid size={{ xs: 6 }}>
|
||||||
@@ -240,7 +240,7 @@ const ProfileForm = () => {
|
|||||||
labelId="status"
|
labelId="status"
|
||||||
name="status"
|
name="status"
|
||||||
required
|
required
|
||||||
placeholder="Select Profesional status"
|
placeholder="Select Professional status"
|
||||||
defaultValue={""}
|
defaultValue={""}
|
||||||
>
|
>
|
||||||
<MenuItem value="">None</MenuItem>
|
<MenuItem value="">None</MenuItem>
|
||||||
@@ -258,7 +258,7 @@ const ProfileForm = () => {
|
|||||||
</Grid>
|
</Grid>
|
||||||
<Grid size={{ xs: 6 }}>
|
<Grid size={{ xs: 6 }}>
|
||||||
<Typography paddingTop="2.3rem">
|
<Typography paddingTop="2.3rem">
|
||||||
Select Profesional Status
|
Select Professional Status
|
||||||
</Typography>
|
</Typography>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid size={{ xs: 12 }}>
|
<Grid size={{ xs: 12 }}>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ interface postState {
|
|||||||
post: Post | null;
|
post: Post | null;
|
||||||
loading: boolean;
|
loading: boolean;
|
||||||
error: {};
|
error: {};
|
||||||
//Todo erros
|
//Todo errors
|
||||||
}
|
}
|
||||||
const initialState: postState = {
|
const initialState: postState = {
|
||||||
posts: [],
|
posts: [],
|
||||||
|
|||||||
@@ -10,6 +10,3 @@ db.createUser({
|
|||||||
});
|
});
|
||||||
|
|
||||||
db.createCollection("todos");
|
db.createCollection("todos");
|
||||||
|
|
||||||
db.todos.insert({ text: "Write code", done: true });
|
|
||||||
db.todos.insert({ text: "Learn about containers", done: false });
|
|
||||||
|
|||||||
Generated
+21
@@ -26,6 +26,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/bcryptjs": "^2.4.2",
|
"@types/bcryptjs": "^2.4.2",
|
||||||
"@types/config": "^3.3.0",
|
"@types/config": "^3.3.0",
|
||||||
|
"@types/cors": "^2.8.17",
|
||||||
"@types/express": "^4.17.17",
|
"@types/express": "^4.17.17",
|
||||||
"@types/gravatar": "^1.8.3",
|
"@types/gravatar": "^1.8.3",
|
||||||
"@types/jsonwebtoken": "^9.0.2",
|
"@types/jsonwebtoken": "^9.0.2",
|
||||||
@@ -116,6 +117,16 @@
|
|||||||
"@types/node": "*"
|
"@types/node": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@types/cors": {
|
||||||
|
"version": "2.8.17",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.17.tgz",
|
||||||
|
"integrity": "sha512-8CGDvrBj1zgo2qE+oS3pOCyYNqCPryMWY2bGfwA0dcfopWGgxs+78df0Rs3rc9THP4JkOhLsAa+15VdpAqkcUA==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@types/node": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@types/express": {
|
"node_modules/@types/express": {
|
||||||
"version": "4.17.17",
|
"version": "4.17.17",
|
||||||
"resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.17.tgz",
|
"resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.17.tgz",
|
||||||
@@ -552,6 +563,7 @@
|
|||||||
"version": "2.8.5",
|
"version": "2.8.5",
|
||||||
"resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz",
|
"resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz",
|
||||||
"integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==",
|
"integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==",
|
||||||
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"object-assign": "^4",
|
"object-assign": "^4",
|
||||||
"vary": "^1"
|
"vary": "^1"
|
||||||
@@ -2209,6 +2221,15 @@
|
|||||||
"@types/node": "*"
|
"@types/node": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@types/cors": {
|
||||||
|
"version": "2.8.17",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.17.tgz",
|
||||||
|
"integrity": "sha512-8CGDvrBj1zgo2qE+oS3pOCyYNqCPryMWY2bGfwA0dcfopWGgxs+78df0Rs3rc9THP4JkOhLsAa+15VdpAqkcUA==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@types/node": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
"@types/express": {
|
"@types/express": {
|
||||||
"version": "4.17.17",
|
"version": "4.17.17",
|
||||||
"resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.17.tgz",
|
"resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.17.tgz",
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/bcryptjs": "^2.4.2",
|
"@types/bcryptjs": "^2.4.2",
|
||||||
"@types/config": "^3.3.0",
|
"@types/config": "^3.3.0",
|
||||||
|
"@types/cors": "^2.8.17",
|
||||||
"@types/express": "^4.17.17",
|
"@types/express": "^4.17.17",
|
||||||
"@types/gravatar": "^1.8.3",
|
"@types/gravatar": "^1.8.3",
|
||||||
"@types/jsonwebtoken": "^9.0.2",
|
"@types/jsonwebtoken": "^9.0.2",
|
||||||
|
|||||||
+6
-3
@@ -1,10 +1,13 @@
|
|||||||
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";
|
||||||
|
import cors from "cors";
|
||||||
|
|
||||||
const app = express();
|
const app = express();
|
||||||
|
|
||||||
|
// add cors otherwise fronend cannot access backedn
|
||||||
|
app.use(cors());
|
||||||
|
|
||||||
connectDB();
|
connectDB();
|
||||||
|
|
||||||
app.use(express.json());
|
app.use(express.json());
|
||||||
@@ -18,7 +21,7 @@ app.use("/api/posts", require("./routers/api/posts"));
|
|||||||
if (process.env.NODE_ENV === "production") {
|
if (process.env.NODE_ENV === "production") {
|
||||||
console.log("in production");
|
console.log("in production");
|
||||||
app.use(express.static("client/build"));
|
app.use(express.static("client/build"));
|
||||||
app.get("*", (req, res) => [
|
app.get("*", (_, res) => [
|
||||||
res.sendFile(path.resolve(__dirname, "client", "build", "index.html")),
|
res.sendFile(path.resolve(__dirname, "client", "build", "index.html")),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-3
@@ -3,11 +3,10 @@
|
|||||||
# systemctl start mongodb.service
|
# systemctl start mongodb.service
|
||||||
|
|
||||||
sn=devCon
|
sn=devCon
|
||||||
cd ~/dev-connect/
|
|
||||||
tmux new-session -s "$sn" -n etc -d "nvim .; exec zsh"
|
tmux new-session -s "$sn" -n etc -d "nvim .; exec zsh"
|
||||||
cd ~/dev-connect/client
|
cd client
|
||||||
tmux new-window -t "$sn:2" -n "client" "npm run dev"
|
tmux new-window -t "$sn:2" -n "client" "npm run dev"
|
||||||
cd ~/dev-connect/server
|
cd ../server
|
||||||
tmux new-window -t "$sn:3" -n "server" "npm run server"
|
tmux new-window -t "$sn:3" -n "server" "npm run server"
|
||||||
|
|
||||||
tmux select-window -t "$sn:1"
|
tmux select-window -t "$sn:1"
|
||||||
|
|||||||
Reference in New Issue
Block a user