Node Faker API is a simple Node.js project that provides endpoints to generate random data for various categories such as Persons, Locations, Ecommerce, Finance, Date, and Localization. This project uses the Faker.js library to generate realistic fake data for testing and development purposes.
- Node.js and npm installed on your machine. You can download and install them from Node.js.
-
Clone the repository:
git clone https://github.com/msaifulcsse/node-faker-api.git cd node-faker-api
-
Install the dependencies:
npm install
Start the server by running the following command:
node index.js
The server will be running on http://localhost:5000
.
- Endpoint:
/api/random-profiles
- Method:
GET
- Description: Returns a list of 10 random profiles.
- Response:
[ { "name": "John Doe", "email": "john.doe@example.com", "address": "123 Main St", "city": "Anytown", "country": "USA" }, ... ]
- Endpoint:
/random-locations
- Method:
GET
- Description: Returns a list of 10 random locations.
- Response:
[ { "address": "123 Main St", "city": "Anytown", "country": "USA" }, ... ]
- Endpoint:
/random-ecommerce
- Method:
GET
- Description: Returns a list of 10 random ecommerce data.
- Response:
[ { "productName": "Awesome Widget", "price": "$19.99" }, ... ]
- Endpoint:
/random-finance
- Method:
GET
- Description: Returns a list of 10 random finance data.
- Response:
[ { "accountNumber": "123456789", "transactionAmount": "$100.00" }, ... ]
- Endpoint:
/random-dates
- Method:
GET
- Description: Returns a list of 10 random dates.
- Response:
[ { "date": "2025-01-18T22:39:00.000Z" }, ... ]
- Endpoint:
/random-localization
- Method:
GET
- Description: Returns a list of 10 random localization data.
- Response:
[ { "locale": "en_US", "phoneNumber": "(555) 555-5555" }, ... ]
- GitHub: M SAIFUL ISLAM
- LinkedIn: M SAIFUL ISLAM
- Email: mailto:saifulbdjoy@gmail.com
This project is licensed under the MIT License. See the LICENSE file for details.
Feel free to customize the `README.md` file as needed. This should give you a good starting point for your project documentation.