-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from mohammedfarisofficial/main
new structure
- Loading branch information
Showing
92 changed files
with
2,539 additions
and
191 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
|
||
# testing | ||
/coverage | ||
|
||
# next.js | ||
/.next/ | ||
/out/ | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
*.pem | ||
|
||
# debug | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
.pnpm-debug.log* | ||
|
||
# local env files | ||
.env*.local | ||
|
||
# vercel | ||
.vercel | ||
|
||
# typescript | ||
*.tsbuildinfo | ||
next-env.d.ts |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Diff not rendered.
Diff not rendered.
Diff not rendered.
Empty file.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
MONGODB_URL="mongodb+srv://mohammedfarisofficial:[email protected]/?retryWrites=true&w=majority" | ||
PORT=3001 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
|
||
# testing | ||
/coverage | ||
|
||
# next.js | ||
/.next/ | ||
/out/ | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
*.pem | ||
|
||
# debug | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
.pnpm-debug.log* | ||
|
||
# local env files | ||
.env*.local | ||
|
||
# vercel | ||
.vercel | ||
|
||
# typescript | ||
*.tsbuildinfo | ||
next-env.d.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import express from "express"; | ||
import bodyParser from "body-parser"; | ||
import mongoose from "mongoose"; | ||
import cors from "cors"; | ||
import dotenv from "dotenv"; | ||
import helmet from "helmet"; | ||
import morgan from "morgan"; | ||
|
||
// import authRouter from "./routes/auth.js"; | ||
// import productRouter from "./routes/product.js"; | ||
// import orderRouter from "./routes/order.js"; | ||
import eventRouter from "./routes/event.js"; | ||
|
||
// import colorRouter from "./routes/color.js"; | ||
// import sizeRouter from "./routes/size.js"; | ||
// import categoryRouter from "./routes/category.js"; | ||
// import reviewRouter from "./routes/review.js"; | ||
|
||
const app = express(); | ||
|
||
dotenv.config(); | ||
app.use(express.json()); | ||
app.use(helmet()); | ||
app.use(helmet.crossOriginResourcePolicy({ policy: "cross-origin" })); | ||
app.use(morgan("common")); | ||
app.use(bodyParser.json({ limit: "30mb", extended: true })); | ||
app.use(bodyParser.urlencoded({ limit: "30mb", extended: true })); | ||
app.use(cors()); | ||
|
||
app.get("/", async (req, res) => { | ||
res.send("MNMLFM backend"); | ||
}); | ||
|
||
app.use("/api/event", eventRouter); | ||
// app.use("/api/products", productRouter); | ||
// app.use("/api/category", categoryRouter); | ||
// app.use("/api/payment", stripeRouter); | ||
// app.use("/api/order", orderRouter); | ||
// //admin || dashboard | ||
// app.use("/api/color", colorRouter); | ||
// app.use("/api/size", sizeRouter); | ||
// app.use("/api/review", reviewRouter); | ||
|
||
//db connection | ||
mongoose.set("strictQuery", true); | ||
mongoose | ||
.connect( | ||
process.env.MONGODB_URL || { | ||
useNewUrlParser: true, | ||
useUnifiedTopology: true, | ||
} | ||
) | ||
.then(() => { | ||
app.listen(process.env.PORT, () => | ||
console.log(`server port ${process.env.PORT}`) | ||
); | ||
}) | ||
.catch((err) => console.log(`${err} : did not connect`)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import mongoose from "mongoose"; | ||
|
||
const eventSchema = new mongoose.Schema({ | ||
title: { | ||
type: String, | ||
required: true, | ||
}, | ||
subTitle: { | ||
type: String, | ||
required: true, | ||
}, | ||
dec: String, | ||
key: String, | ||
data: String, | ||
youtubeLink: String, | ||
}); | ||
|
||
const Event = mongoose.model("Event", eventSchema); | ||
export default Event; |
Oops, something went wrong.