Write Luna API Calls
Luna API
Write, Document, Publish
Download
Download Luna from https://github.com/eurog33k/luna and use this as a start template for writing your API calls
Setup / Configuration
DataBase:
Specify your database connection information via the Luna App's properties.
The following properties need to be set so that Luna would be able to access the database.
DatabaseHost: the database host address (for all databases except SQLite)
DatabaseName: the name of the database
DatabaseUserName: the database user name
DatabasePassword: the password for the database user
HTTP/HTTPS:
Additionally, you can require that connections to the API be secure by setting the SecureConnectionsRequired property to True.
Implement your API's authentication scheme via the app's RequestAuthenticate method. A very simple example of an authentication scheme is provided in the Xojo project.
Writing your API Calls:
For each endpoint that you wish to support, create a corresponding app method. Name the methods according to the entities and actions that you wish to support, as well as the version of the API that the method is intended for.
For example, a method to support the creation of a new contact would be named v1_Contacts_POST.
Sample methods have been included in the Xojo project.
They demonstrate how you might implement endpoints for GET, POST, PUT, PATCH, and DELETE actions. (PATCH cannot be currently documented LunaAPI2Swagger)