Created
April 6, 2022 17:19
-
-
Save DiegoDoniss/06f7ec1cb1ba808f56f98cb3520bb1c9 to your computer and use it in GitHub Desktop.
Typescript: Express initial app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//importaciones de express | |
import express, { Application, json, urlencoded } from "express"; | |
import cors from "cors"; | |
import dotenv from 'dotenv' | |
//importacion de rutas | |
dotenv.config() | |
function settings(): void { | |
app.set("port", process.env.PORT || 3000); | |
} | |
//midlewares a implementar | |
function midlewares(): void { | |
app.use(cors()); | |
app.use(json()); | |
app.use(urlencoded({ extended: false })); | |
} | |
//rutas | |
function routes(): void { | |
} | |
export const app: Application = express() | |
settings() | |
midlewares() | |
routes() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment