Snips action code for the Nutrition app
# Install the dependencies, builds the action and creates the config.ini file.
sh setup.sh
Don't forget to edit the config.ini
file.
To be able to make calls to the API, you must have a FatSecret Platform REST API key.
An assistant containing the intents listed below must be installed on your system. Deploy it following these instructions.
- Dev mode:
# Dev mode watches for file changes and restarts the action.
npm run dev
- Prod mode:
# 1) Lint, transpile and test.
npm start
# 2) Run the action.
npm run launch
This app only supports english ๐ฌ๐ง. French ๐ซ๐ท will probably be supported in the future.
Get nutritional information for the given food
Hey Snips, how many calories are in a serving of spaghetti?
Hey Snips, how much vitamin A is in a carrot?
Compare the nutritional info between the two given foods
Hey Snips, how much vitamin C in an orange compared to a lemon?
In the src/index.ts
file:
// Uncomment this line to print everything
// debug.enable(name + ':*')
Requires mosquitto to be installed.
npm run test
In test mode, i18n output and http calls are mocked.
- http: are written in
tests/httpMocks/index.ts
- i18n: mocked by
snips-toolkit
, see the documentation.