https://github.com/mehradi-github/ref-rtk-crud-api
Node.js - RESTful API
https://github.com/mehradi-github/ref-rtk-crud-api
Last synced: about 1 year ago
JSON representation
Node.js - RESTful API
- Host: GitHub
- URL: https://github.com/mehradi-github/ref-rtk-crud-api
- Owner: mehradi-github
- License: mit
- Created: 2023-10-26T06:28:10.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-11-06T08:16:43.000Z (over 2 years ago)
- Last Synced: 2025-02-05T07:12:06.139Z (over 1 year ago)
- Language: TypeScript
- Size: 33.2 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Node.js - RESTful API
## Init Project
```sh
pnpm init
pnpm add -D typescript
pnpm add @types/node
npx tsc --init --rootDir src --outDir build \
--esModuleInterop --resolveJsonModule --lib es6 \
--module commonjs --allowJs true --noImplicitAny true
echo "console.log('Hello world!');" > ./src/index.ts
# build
pnpm tsc
# OR
pnpm add -D ts-node nodemon
```
Add a nodemon.json config.
```json
{
"watch": ["src"],
"ext": ".ts,.js",
"ignore": [],
"exec": "pnpm ts-node ./src/index.ts"
}
```
./package.json
```json
{
"scripts": {
"start:dev": "pnpm nodemon"
}
}
```
## Adding Api
```sh
pnpm add express @types/express
```