mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-22 07:15:25 +00:00
Generate clients (#206)
This commit is contained in:
6
examples/quran/summary/curl/getChapterSummary.sh
Executable file
6
examples/quran/summary/curl/getChapterSummary.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
curl "https://api.m3o.com/v1/quran/Summary" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Authorization: Bearer $MICRO_API_TOKEN" \
|
||||
-d '{
|
||||
"chapter": 1
|
||||
}'
|
||||
16
examples/quran/summary/go/getChapterSummary.go
Executable file
16
examples/quran/summary/go/getChapterSummary.go
Executable file
@@ -0,0 +1,16 @@
|
||||
package example
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/micro/services/clients/go/quran"
|
||||
"os"
|
||||
)
|
||||
|
||||
// Get a summary for a given chapter (surah)
|
||||
func GetChapterSummary() {
|
||||
quranService := quran.NewQuranService(os.Getenv("MICRO_API_TOKEN"))
|
||||
rsp, err := quranService.Summary(&quran.SummaryRequest{
|
||||
Chapter: 1,
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
12
examples/quran/summary/node/getChapterSummary.js
Executable file
12
examples/quran/summary/node/getChapterSummary.js
Executable file
@@ -0,0 +1,12 @@
|
||||
import * as quran from "m3o/quran";
|
||||
|
||||
// Get a summary for a given chapter (surah)
|
||||
async function GetChapterSummary() {
|
||||
let quranService = new quran.QuranService(process.env.MICRO_API_TOKEN);
|
||||
let rsp = await quranService.summary({
|
||||
chapter: 1,
|
||||
});
|
||||
console.log(rsp);
|
||||
}
|
||||
|
||||
await GetChapterSummary();
|
||||
Reference in New Issue
Block a user