This is a simple Node.js Express application that provides CRUD (Create, Read, Update, Delete) operations for managing dogs. It uses an in-memory array to store dog data. Each dog object includes properties such as name
, breed
, age
, and favoriteToy
.
These instructions will help you get the project up and running on your local machine for development and testing purposes.
What things you need to install the software and how to install them:
- Node.js
- npm (Node Package Manager)
A step-by-step series of examples that tell you how to get a development environment running:
-
Clone the repository:
git clone [repository_url]
-
Navigate to the project directory:
cd [project_name]
-
Install dependencies:
npm install
Run the application with the following command:
npm start
The server will start and listen for requests on http://localhost:3000.
The application supports the following endpoints:
GET /dogs
: Fetch all dogs.GET /dogs/:id
: Fetch a single dog by ID.POST /dogs
: Add a new dog.PUT /dogs/:id
: Update an existing dog by ID.DELETE /dogs/:id
: Delete a dog by ID.
To run the automated tests for this system, use the following command:
npm test
- Node.js - The JavaScript runtime
- Express - The web framework
- Jest - The testing framework
- Supertest - The library for testing HTTP