Commit 4591548a by Denys Tito Urbano

Initial commit

parents
PORT=
SECRET_KEY=
DB_POSTGRESQL_SIIAA_HOST=
DB_POSTGRESQL_SIIAA_PORT=
DB_POSTGRESQL_SIIAA_NAME=
DB_POSTGRESQL_SIIAA_USERNAME=
DB_POSTGRESQL_SIIAA_PASSWORD=
URL_FACTURACION_ELECTRONICA_SIIAA=
URL_TRISMEGISTO_APIS=
\ No newline at end of file
node_modules/
.vscode/
\ No newline at end of file
const Server = require("./server");
const server = new Server();
server.listen();
\ No newline at end of file
{
"name": "tma",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"axios": "^0.27.2",
"body-parser": "^1.20.0",
"cors": "^2.8.5",
"dotenv": "^16.0.1",
"express": "^4.18.1",
"express-validator": "^6.14.2",
"jsonwebtoken": "^8.5.1",
"pg-promise": "^10.11.1"
}
}
const express = require('express');
const cors = require('cors');
require('dotenv').config();
class Server {
constructor() {
this.app = express();
this.port = process.env.PORT;
this.middlewares();
this.routes();
}
routes() {
}
middlewares() {
// Activando CORS
this.app.use(cors());
// Convertir datos del body a JSON
this.app.use(express.json());
}
listen() {
this.app.listen(this.port);
}
}
module.exports = Server;
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment