Skip to content

Commit

Permalink
Add neighborhoods and villages to API, update population data, and ad…
Browse files Browse the repository at this point in the history
…d Swagger UI
  • Loading branch information
ubeydeozdmr committed Mar 1, 2024
1 parent c2f8384 commit e5e6a80
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 10 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,24 @@ The API uses [turkiyeapi.dev](https://turkiyeapi.dev) as the main domain. But yo

## What's new?

> _Latest update: March 1, 2024_
- Neighborhoods and villages have been added to the API. (Experimental)
- Swagger UI has been added to the API. You can now use the API with the Swagger UI.
- Population data has been updated from 2021 to 2023. (2023 data has been released by TUIK, early 2024)

## Sources

- [Population of districts](https://biruni.tuik.gov.tr/medas)
- [Area of districts](https://web.archive.org/web/20190416051733/https://www.harita.gov.tr/images/urun/il_ilce_alanlari.pdf)

## Documentation

[API Documentation](https://turkiyeapi.dev/docs)
[Examples](https://turkiyeapi.dev/examples)
[Postman Collection](https://documenter.getpostman.com/view/19561492/UzBguVHM)
[Swagger UI](https://turkiyeapi.dev/swagger)

## Usage of API

## Provinces
Expand Down
28 changes: 18 additions & 10 deletions src/swagger.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
const swaggerJSDoc = require('swagger-jsdoc');
require('dotenv').config();

const isProduction = process.env.NODE_ENV === 'production';

const servers = isProduction
? [
{
url: 'https://turkiyeapi.dev/api/v1/',
description: 'Production server',
},
]
: [
{
url: 'http://localhost:8181/api/v1/',
description: 'Development server',
},
];

const swaggerDefinition = {
openapi: '3.0.0',
Expand All @@ -16,16 +33,7 @@ const swaggerDefinition = {
email: 'ubeydeozdmr@gmail.com',
},
},
servers: [
{
url: 'http://localhost:8181/api/v1/',
description: 'Development server',
},
{
url: 'https://turkiyeapi.dev/api/v1/',
description: 'Production server',
},
],
servers,
};

const options = {
Expand Down

0 comments on commit e5e6a80

Please sign in to comment.