An API to manage information about locations.
Make sure you have Node.js installed on your machine.
- Clone this repository:
git clone https://github.com/Ismaias/project-location-nestjs.git
- Install dependencies:
cd project-location-nestjs npm install
- Set up environment variables:
Create a .env file in the project root using the provided .env.example file as a template. Replace the placeholders with appropriate values, such as LOCATION_API_CONNECTION_STRING for the database connection.
To start the local server:
npm run start:dev
The server will run at http://localhost:3000
.
- URL:
POST /v1/locations
- Request body:
{ "name": "Central Park", "city": "New York City", "state": "NY" }
- URL:
GET /v1/locations
- Retrieves a list of all locations.
- URL:
GET /v1/locations/:id
- Retrieves a specific location by ID.
- URL:
PUT /v1/locations/:id
- Request body:
{ "name": "Updated Park", "city": "New City", "state": "NC" }
Replace :id
with the ID of the location to update.
- URL:
DELETE /v1/locations/:id
- Deletes a specific location by ID.
- URL:
POST /v1/auth/signup
- Request body:
{ "email": "user123", "password": "securepassword" }
- URL:
POST /v1/auth/login
- Request body:
{ "email": "user123", "password": "securepassword" }
To run tests:
npm test
Feel free to contribute! Open an issue or submit a pull request.