-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,5 +16,6 @@ | |
"mongodb": "^5.6.0", | ||
"mongoose": "^5.13.8", | ||
"nodemon": "^3.0.1" | ||
} | ||
}, | ||
"devDependencies": {} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import app from "./src/app.js"; | ||
import chalk from "chalk"; | ||
|
||
const port = 2727; | ||
|
||
app.listen(port, () => { | ||
console.log( | ||
chalk.green.bgGray.bold(`Servidor está rodando na porta, ${port}`) | ||
); | ||
}); | ||
|
||
export default app; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import express, { json } from "express"; | ||
import index from "./routes/index.js"; | ||
import db from "./config/dbconnect.js"; | ||
import projetos from "./routes/projeto.js"; | ||
import chalk from "chalk"; | ||
|
||
const app = express(); | ||
|
||
app.use (json()); | ||
app.use ("/", index); | ||
app.use ("/projetos", projetos); | ||
|
||
db.on("error", console.log.bind(console, "erro de conexão")); | ||
db.once ("open", () =>{ | ||
consle.log( | ||
chalk.green.bgRgb(180, 180, 180).bold("conexão com o banco feita com sucesso") | ||
); | ||
}); | ||
|
||
export default app; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import mongoose from "mongoose" | ||
|
||
mongoose.connect( | ||
"mongodb+srv:https://admin:[email protected]/git" | ||
); | ||
|
||
let db = mongoose.connection; | ||
|
||
export default db; |