Commit from GitHub Actions (Publish APIs & Clients)

This commit is contained in:
asim
2021-09-22 19:20:19 +00:00
parent 2d702178d3
commit 77c32acee8
9 changed files with 44 additions and 7 deletions

View File

@@ -0,0 +1,7 @@
curl "https://api.m3o.com/v1/weather/Forecast" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MICRO_API_TOKEN" \
-d '{
"days": 2,
"location": "London"
}'

View File

@@ -0,0 +1,17 @@
package example
import (
"fmt"
"github.com/micro/services/clients/go/weather"
"os"
)
// Get the weather forecast for the next 1-10 days
func ForecastWeather() {
weatherService := weather.NewWeatherService(os.Getenv("MICRO_API_TOKEN"))
rsp, err := weatherService.Forecast(&weather.ForecastRequest{
Days: 2,
Location: "London",
})
fmt.Println(rsp, err)
}

View File

@@ -0,0 +1,13 @@
import * as weather from "m3o/weather";
// Get the weather forecast for the next 1-10 days
async function ForecastWeather() {
let weatherService = new weather.WeatherService(process.env.MICRO_API_TOKEN);
let rsp = await weatherService.forecast({
days: 2,
location: "London",
});
console.log(rsp);
}
await ForecastWeather();