Last active
July 19, 2021 19:16
-
-
Save maiasb/b6824051c206259a45f60af6ca5a06a7 to your computer and use it in GitHub Desktop.
Anotações para o Node.js
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
Iniciar package.json: | |
yarn init -y | |
Iniciar tsconfig.json: | |
yarn tsc --init | |
Adicionar e testar lib cors (Permite que aplicações front-end acessem suas rotas): | |
// Adicionar cors | |
yarn add cors; | |
// Adicionar tipagens do cors | |
yarn add @types/cors -D | |
Adicionar cors no server: | |
import cors from "cors"; | |
app.use(cors()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment