Skip to content

Commit

Permalink
new version 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
halituzan committed Mar 21, 2023
1 parent f308750 commit 411c567
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@
```
const getWord=require('tdk-all-api');
const results = async (searching) => {
const results = async (searching,uri) => {
try {
const sonuc = await getWord(searching);
const sonuc = await getWord(searching,"YOUR_PROXY_URL(optional)");
console.log(sonuc);
} catch (e) {
console.error(e);
Expand All @@ -150,6 +150,15 @@ word: "yazılım"
}
```

## Parameters
1.0.0 sürümünde fonksiyona ikinci parametre olarak url parametresi eklenmiştir. Uygulamanızı canlıya alma aşamasına getirdiğinizde alabileceğiniz CORS hatalarını önlemek için proxy url'nizi kullanabilirsiniz. Bunu işleve ikinci bir parametre olarak bildirebilirsiniz. 2. parametre opsiyoneldir, varsayılan olarak TDK'nın API endpointi tanımlanmıştır.

| # | Parameters | Example | Type |Requirement|
|---|-------------|-------------|------------|-----------|
| 1.| Search Word | "Yazılım" | string | yes |
| 2.| Proxy Url | "/api" | string | optional |

## License


ISC (c) Halit Uzan <[email protected]>
3 changes: 1 addition & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const axios = require("axios");
const uri = "https://sozluk.gov.tr/";
module.exports = async function (word) {
module.exports = async function (word, uri = "https://sozluk.gov.tr/") {
const datas = {
word: null,
lisan: null,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tdk-all-api",
"version": "0.0.2",
"version": "1.0.0",
"description": "Türk dil kurumunun tüm sözlüklerini kapsayacak bir modüldür.",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 411c567

Please sign in to comment.