Usage
GET /forecast?city=%CITY_NAME%&%OPEN_METEO_API_PARAMS%
For instance
GET /forecast?city=Moscow&timezone=auto&forecast_days=3&hourly=temperature_2m
To build application and setup topology:
cartridge build
cartridge start -d
cartridge replicasets setup --bootstrap-vshardNow you can visit http://localhost:8081 and see your application's Admin Web UI.
Note, that application stateboard is always started by default.
See .cartridge.yml file to change this behavior.
Application entry point is init.lua file.
It configures Cartridge, initializes admin functions and exposes metrics endpoints.
Before requiring cartridge module package_compat.cfg() is called.
It configures package search path to correctly start application on production
(e.g. using systemd).
Application has one simple role, app.roles.custom.
It exposes /hello and /metrics endpoints:
curl localhost:8081/hello
curl localhost:8081/metricsAlso, Cartridge roles are registered
(vshard-storage, vshard-router and metrics).
You can add your own role, but don't forget to register in using
cartridge.cfg call.
Configuration of instances that can be used to start application
locally is places in instances.yml.
It is used by cartridge start.
Topology configuration is described in replicasets.yml.
It is used by cartridge replicasets setup.
Simple unit and integration tests are placed in test directory.
First, we need to install test dependencies:
./deps.shThen, run linter:
.rocks/bin/luacheck .Now we can run tests:
cartridge stop # to prevent "address already in use" error
.rocks/bin/luatest -vApplication has admin function probe configured.
You can use it to probe instances:
cartridge start -d # if you've stopped instances
cartridge admin probe \
--name meteo_cache \
--run-dir ./tmp/run \
--uri localhost:3302