PATRÓN DE DISEÑO INYECCIÓN DE DEPENDENCIAS
Plantilla estándar para construir una Rest API con Typecript y Express utilizando el patrón inyección de dependencias.
-
Descargar el repositorio con git clone e instalar las dependencias.
npm i
-
Para correr el proyecto, ejecutar el comando:
Nota:npm run start
En el archivo tsconfing.json ya se encuentra configurado, el directorio donde se almacenan los archivos transpilados de .ts a .js
En la raiz del proyecto se debe generar un archivo .env que contenga las variables de entorno.
Variable Ejemplo HOST http://localhost PORT 8009 API_ROOT /v1 URL_CONTEXT /api DBNAME mydbname DBUSER mydbuser BDPASS mydbpass DBHOST http://mydbhost o ip DIALECT mysql WHITELIST http://localhost o domain