Skip to content
Empty file added README-DB.md
Empty file.
1 change: 1 addition & 0 deletions README-FF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
este es otro archivo readme ff
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Instalar node js en Windows

Descarga el instalador:

Ve al sitio oficial de Node.js: Node.js. https://nodejs.org/en/download/package-manager

Selecciona el instalador para Windows (archivo .msi) según si tu sistema es de 64 bits o 32 bits.

Haz clic en Siguiente para comenzar la instalación12.

Ejecuta el instalador:

Abre el archivo descargado (.msi).

Sigue las instrucciones del instalador, aceptando la licencia y seleccionando la ubicación de instalación.

Una vez completada la instalación, tendrás acceso al programa ejecutable node en la línea de comando


abrir terminal
node -v
npm -v

INSTALL
=======


npm i express

npm i nodemon -D
npm run start
npm mongoose
Empty file added readme--lll.md
Empty file.
Empty file added readme2--lll.cd
Empty file.
Empty file added readme3--lll.cd
Empty file.
2 changes: 1 addition & 1 deletion request.http
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ POST http://localhost:9000/api/users HTTP/1.1
Content-Type: application/json

{
"name": "Nikola Tesla",
"name": "Nikola Tesla UNI",
"age": 80,
"email": "[email protected]"
}
Expand Down
9 changes: 5 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ app.get("/", (req, res) => {
});

// mongodb connection
mongoose
.connect(process.env.MONGODB_URI)
.then(() => console.log("Connected to MongoDB Atlas"))
.catch((error) => console.error(error));
//mongoose
// .connect(process.env.MONGODB_URI)
// .then(() => console.log("Connected to MongoDB Atlas"))
// .catch((error) => console.error(error));
mongoose.connect("mongodb+src://");

// server listening
app.listen(port, () => console.log("Server listening to", port));