// 1. IMPORTACIONES
const express = require("express")
const app = express()
const mongoose = require("mongoose")
const hbs = require("hbs")
const connectingDB = require("./config/db")
// 2. MIDDLEWARES
//CONECTAR DB
connectingDB()
require('dotenv').config()
// 3. RUTEO
// 4. SERVIDOR
app.listen(process.env.PORT, () => {
console.log("El servidor está activado")
})
//recuerda crear una carpeta de config y archivo .env donde se pone PORT=3000
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter