This project is an open API implementation using TypeScript. It provides a set of common data and utilities for various countries, including city names, first names, last names, and more.
- Common data for multiple countries
- Utility functions for data handling
- Modular structure for easy extension
- URL:
/user/:country
- Method:
GET
- URL Params:
country=[string]
(required)
- Success Response:
- Code: 200
- Content:
{ "FirstName": "John", "LastName": "Doe", "Gender": "male", "Email": "[email protected]", "Phone": "123-456-7890", "Address": { "Street": "123 Main St", "City": "Anytown", "State": "Anystate", "Zip": "12345" } }
- Error Response:
- Code: 404 NOT FOUND
- Content:
{ "status": "error", "message": "Country not found" }
- Code: 500 INTERNAL SERVER ERROR
- Content:
{ "status": "error", "message": "Internal server error" }
curl -X GET "http://localhost:3000/user/US"
{
"FirstName": "John",
"LastName": "Doe",
"Gender": "male",
"Email": "[email protected]",
"Phone": "123-456-7890",
"Address": {
"Street": "123 Main St",
"City": "Anytown",
"State": "Anystate",
"Zip": "12345"
}
}
- @nestjs/common: ^10.0.0
- @nestjs/core: ^10.0.0
- @nestjs/platform-express: ^10.0.0
- axios: ^1.8.1
- reflect-metadata: ^0.2.0
- rxjs: ^7.8.1
To get started with this project, clone the repository and install the dependencies:
$ git clone <repository-url>
$ cd open-api-TS
$ bun install or $ npm install
To run tests, use the provided scripts in package.json
:
$ npm test
$ npm run test:watch
$ npm run test:cov
$ npm run test:debug
$ npm run test:e2e
For more information on the available API endpoints, please refer to the API Endpoints Documentation.
We welcome contributions! Please see the CONTRIBUTING.md file for guidelines on how to contribute to this project.
This project is licensed under the MIT License. See the LICENSE file for more details.