Public holidays API (#212)

This commit is contained in:
Dominic Wong
2021-09-21 18:51:19 +01:00
committed by GitHub
parent 09b06bd66f
commit 33653f7698
29 changed files with 1816 additions and 7 deletions

View File

@@ -0,0 +1,4 @@
curl "https://api.m3o.com/v1/holidays/Countries" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MICRO_API_TOKEN" \
-d '{}'

View File

@@ -0,0 +1,14 @@
package example
import (
"fmt"
"github.com/micro/services/clients/go/holidays"
"os"
)
//
func ListCountries() {
holidaysService := holidays.NewHolidaysService(os.Getenv("MICRO_API_TOKEN"))
rsp, err := holidaysService.Countries(&holidays.CountriesRequest{})
fmt.Println(rsp, err)
}

View File

@@ -0,0 +1,12 @@
import * as holidays from "m3o/holidays";
//
async function ListCountries() {
let holidaysService = new holidays.HolidaysService(
process.env.MICRO_API_TOKEN
);
let rsp = await holidaysService.countries({});
console.log(rsp);
}
await ListCountries();