https://github.com/timxor/nodejs-typescript-api-server
nodejs-typescript-api-server
https://github.com/timxor/nodejs-typescript-api-server
Last synced: 4 months ago
JSON representation
nodejs-typescript-api-server
- Host: GitHub
- URL: https://github.com/timxor/nodejs-typescript-api-server
- Owner: timxor
- License: mit
- Created: 2024-02-01T03:40:14.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-03-29T17:01:56.000Z (over 1 year ago)
- Last Synced: 2024-04-14T12:59:28.267Z (about 1 year ago)
- Language: JavaScript
- Homepage: https://nodejs-typescript-api-server.vercel.app
- Size: 33.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nodejs-typescript-api-server
nodejs-typescript-api-server
# Quick Start
# Installation and Start Server
```
npm install
brew install jq
npm run start
```# Test endpoint is running
```
curl http://localhost:3000/
```# Create a New Book (POST)
```
curl -X POST http://localhost:3000/books \
-H "Content-Type: application/json" \
-d '{"title": "The Hobbit", "author": "J.R.R. Tolkien"}'
```# Read All Books (GET)
```
curl http://localhost:3000/books | jq
```# Read a Single Book (GET)
```
curl http://localhost:3000/books/1 | jq
```# Update a Book (PUT)
```
curl -X PUT http://localhost:3000/books/1 \
-H "Content-Type: application/json" \
-d '{"title": "The Hobbit", "author": "J.R.R. Tolkien Updated"}'
```# Delete a Book (DELETE)
```
curl -X DELETE http://localhost:3000/books/1
```