-
Notifications
You must be signed in to change notification settings - Fork 0
API Reference
sgohl edited this page Feb 1, 2024
·
2 revisions
For your custom api/
routes, wish already sets some useful variables for you (see index.sh
)
For plugs, ${COMMAND}
will resolve into the plug name and get shifted so you can use ${COMMAND}
in your api.sh
to easily case the next uri part.
Example: localhost/api/acme/list/something
- if there is a plug found called
acme
(/www/app/plug/acme/api.sh
),COMMAND
will be the plug-name, then shifted tolist
andARGS
will containsomething
so your plug app/plug/acme/api.sh
may look like this:
case ${COMMAND} in
list)
call_your_list_function ${ARGS}
;;
esac