Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/johnsi15/aprendiendo-ts-express
https://github.com/johnsi15/aprendiendo-ts-express
Last synced: 4 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/johnsi15/aprendiendo-ts-express
- Owner: johnsi15
- Created: 2023-07-20T02:00:51.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-08-29T15:28:36.000Z (about 1 year ago)
- Last Synced: 2024-04-15T03:00:05.275Z (7 months ago)
- Language: TypeScript
- Size: 71.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Express with TypeScript
## Initial config tsconfig
### Install TypeScript
`npm install typescript -D -E`### Add tsc script to package.json
```json
"scripts": {
"tsc": "tsc"
}
```
This generates the code JS for prod### Init config tsc
`npm run tsc -- --init`### Add types express
`npm install @types/express -D -E`### Add dev mode
`npm install ts-node-dev -D -E`### Add dev script to package.json
```json
"scripts": {
"dev": "ts-node-dev src/index.ts"
}
```
### Add Eslint with ts-standard
`npm install ts-standard -D -E````json
"scripts": {
"lint": "ts-standard"
}
```
and add in the `packa.json`:
```json
"eslintConfig": {
"parserOptions": {
"project": "./tsconfig.json"
},
"extends": [
"./node_modules/ts-standard/eslintrc.json"
]
}
```
Check if eslint is configured correctly## Start project
### ¿How does that work?
Require Node.js 18.x
* `npm install` to install the dependencies
* `npm run dev` to run development mode app
* `npm start` to build productionhttps://blog.logrocket.com/how-to-set-up-node-typescript-express/