-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
35 lines (28 loc) · 958 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import morgan from "morgan";
import { mongoose } from 'mongoose';
import express from 'express';
import path from 'path';
import dotenv from "dotenv";
/* ---------------------- Instancia de servidor ----------------------*/
const app = express();
/* ---------------------- Middlewares ---------------------- */
app.use(express.static('public'));
app.use(express.json());
// DAO - config
//const ConnName = "configFire.js";
import {config} from './utils/config.js';
dotenv.config();
import {carritoDAO,productosDao} from './dao/index.js';
//Routes
const router1= express.Router();
router1.use(function (req, res, next) {
console.log('Time:', Date.now());
next();
});
//Rutas
import { CONNREFUSED } from 'dns';
/* ---------------------- Servidor ----------------------*/
const PORT = 8080;
const server = app.listen(PORT, ()=>{
console.log(`Servidor escuchando en puerto http://localhost:${PORT}`);
})