This is a derived version of TinyQueries PHP-libs. It can be used to set up a REST api based on a list of compiled queries.
-
Note 1: It is assumed you already have an account for TinyQueries. If you don't have one, please sign up first.
-
Note 2: The installation will be done by just downloading the ZIP and copy the files to your webserver. If you prefer to install TinyQueries using Composer we suggest to use TinyQueries PHP-libs.
Follow the instructions below to setup a TinyQueries API:
-
Download the latest release of this repo as ZIP
-
Upload the files to a folder inside the document-root of your server. For example, place it in a folder such that you can access it through
http://www.myserver.com/api/ -
Make a copy of the file
config/config.template.xmland call itconfig/config.xml. Fill in the following fields:<database>attributes 'driver', 'name', 'user', 'password', etc.<compiler>attribute 'api_key' - You can find your api-key on the dashboard of your TinyQueries account.
-
In the TinyQueries editor go to Config > Publish settings. In the field 'Publish to' set the URL of the api, so for example
http://www.myserver.com/api. You can use localhost as well if your server runs on your laptop. -
If you don't use Apache, ensure you do the same URL-rewriting as is done in
.htaccess. Furthermore ensure that the foldersconfig,libsandqueriesare not accessible. -
You can start creating queries. When you compile them, they are published to your webserver. The queries can be called using the api by
http://www.myserver.com/api/{myQuery}. So for examplehttp://www.myserver.com/api/helloWorldshould work after you compile for the first time.