Skip to content

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)

COMMAND & ARGS

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 to list and ARGS will contain something

so your plug app/plug/acme/api.sh may look like this:

case ${COMMAND} in

    list)

        call_your_list_function ${ARGS}

    ;;

esac
Clone this wiki locally