File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- # simple-api
1+ # Simple API in TypeScript
22
3- To install dependencies:
3+ A lightweight and minimal REST API built with TypeScript, Express, and SQLite.
44
5- ``` bash
6- bun install
5+ ## Features
6+
7+ - Express.js for handling API routes
8+ - SQLite3 as the database (without Prisma)
9+ - TypeScript for type safety
10+ - Supertest and Bun.js for testing
11+
12+ ## Installation
13+
14+ ** Ensure you have the following installed:**
15+
16+ - Node.js (>=16)
17+ - Bun (for testing, optional)
18+
19+ ** Clone the Repository:**
20+
21+ ```
22+ git clone https://github.com/BaseMax/simple-api-typescript.git
23+ cd simple-api-typescript
24+ ```
25+
26+ ** Install Dependencies**
27+
28+ ```
29+ npm install
30+ ```
31+
32+ ## Usage
33+
34+ ** Start the Server:**
35+
36+ ```
37+ npm run dev
738```
839
9- To run:
40+ This will start the API on ` http://localhost:3000 ` .
1041
11- ``` bash
12- bun run src/app.ts
42+ ** Run Tests:**
43+
44+ ```
45+ bun test
46+ ```
47+
48+ ## API Endpoints
49+
50+ ### Create a User
51+
52+ POST /users
53+
54+ Request Body:
55+ ```
56+ {
57+ "name": "John Doe",
58+ "email": "johndoe@example.com"
59+ }
1360```
1461
15- This project was created using ` bun init ` in bun v1.2.2. [ Bun] ( https://bun.sh ) is a fast all-in-one JavaScript runtime.
62+ ### Get All Users
63+
64+ GET /users
65+
66+ ### Get a User by ID
67+
68+ GET /users/: id
69+
70+ ### Delete a User
71+
72+ DELETE /users/: id
73+
74+ ## License
75+
76+ This project is licensed under the MIT License.
77+
78+ Copyright (c) 2025 BaseMax
You can’t perform that action at this time.
0 commit comments