Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove duplicate css and add .catch(). #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion admin-client/src/components/AddCourse.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function AddCourse() {
const [image, setImage] = useState("");
const [price, setPrice] = useState(0)

return <div style={{display: "flex", justifyContent: "center", minHeight: "80vh", justifyContent: "center", flexDirection: "column"}}>
return <div style={{display: "flex", minHeight: "80vh", justifyContent: "center", flexDirection: "column"}}>
<div style={{display: "flex", justifyContent: "center"}}>
<Card varint={"outlined"} style={{width: 400, padding: 20, marginTop: 30, height: "100%"}}>
<TextField
Expand Down
7 changes: 5 additions & 2 deletions server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,16 @@ app.use(express.json());
app.use("/admin", adminRouter)
app.use("/user", userRouter)

app.use(express.static("public"));
app.use(express.static(path.join(__dirname, "/public")));
app.use("/*", (req, res) => {
res.sendFile(path.join(__dirname, "/public/index.html"))
})

// Connect to MongoDB
// DONT MISUSE THIS THANKYOU!!
mongoose.connect('mongodb+srv://kirattechnologies:[email protected]/admin?authSource=admin&replicaSet=atlas-ue73sj-shard-0&readPreference=primary&appname=MongoDB%20Compass&ssl=true', { useNewUrlParser: true, useUnifiedTopology: true, dbName: "courses" });

mongoose.connect('mongodb+srv://kirattechnologies:[email protected]/admin?authSource=admin&replicaSet=atlas-ue73sj-shard-0&readPreference=primary&appname=MongoDB%20Compass&ssl=true', { useNewUrlParser: true, useUnifiedTopology: true })
.then(() => console.log('MongoDb connected sucessfully...'))
.catch(err => console.log(err));

app.listen(3000, () => console.log('Server running on port 3000'));