About | Motivation | Requirements | Installation | Usage | License
This API has a letter search filter, which returns successful queries to the WeatherStack API. To add new queries that were successful, you need to save them in the database.
This project was made for a challenge made by a job selection process. The API was made especially to save the city queries made to the WeatherStack API and provide a better user experience when typing in the search bar and ensuring a certain result.
To run this project you'll need the following programs installed on your machine:
To install the project open your command prompt and run the following command:
git clone https://github.com/felipedev1/cities-weatherstack-api.git
To create the local database you will need to do the following steps:
- Open the project in Visual Studio 2019
- Open the Package Manager Console
- Run the following command
Update-Database
Base API URL: https://localhost:44360
To run the project just click on the IIS Express, and it will open at the link https://localhost:44360/swagger, showing all the endpoints.
Get cities by letter
-
URL
/api/cities
-
Method:
GET
-
URL Params
query=[string]
-
Data Params
None
-
Success Response:
- Code: 200
Content:{ id: number, cityName : string, country: string, region: string }
- Code: 200
Save cities
-
URL
/api/cities
-
Method:
POST
-
URL Params
None
-
Data Params
{ cityName: string, country: string, region: string }
-
Success Response:
- Code: 200
Content:{ id: number, cityName : string, country: string, region: string }
- Code: 200
This project is under the MIT license. See the LICENSE for details.