This guide will walk you through creating an API file and a basic Get REST API endpoint that will return the a Hello World message.
Open the workspace
(If you haven't created an example workspace, create a workspace called papihello. See Using Workspaces)
Open the example workspace by pointing your browser to the URL:
http://[HOST]:[PORT]/ide/papihello
Where host is the server you installed Profound.js on and port is the port number Profound.js is running on. If the installation is on your PC or Mac computer, use localhost.
OR open the workspace from the ide with the Open button and then select the example workspace:
Create API file
Create a new API json file by clicking the New button and selecting API file. The file will be opened and the Canvas, Parameters, API Routes, and Properties panel will be initialized.
Set Properties
On the left hand lower panel select the General Info tab and fill on the following values
- Name: hello
- Summary: hello world example
HTTP Method: get
HTTP Path: /helloworld
- Category, Sub Category, Tag, and Description all help improve documentation and organization.
Save
At this point you should save your API file by clicking the Save button in the menu ribbon. The first time you use save you will be presented a save dialog with the File Name defaulting to Unnamed.api.json. You should change the Unnamed portion to an appropriate file name, like Employee.api.json in this case. Click Save.