-
Notifications
You must be signed in to change notification settings - Fork 0
Getting the content of a page
To get the main content of any page, you should make a call to the route
GET api/page/{pageName}
This will try to read a file named {pageName}.md
in the server's folder containing the main pages. If the file is found, then its content will be returned in a json object.
This route is accessible with no authrization at all.
Parameter | Data type | Description | Example |
---|---|---|---|
pageName |
string |
The name of the page looked for. If it contains spaces, they should be replaced by underscores | File_Name1 |
There are no optional parameters to give for this route.
As a GET request, the body should remain empty.
When "successful", this route returns a 200 or a 204 HTTP code. The 204 code means that the page wasn't found, however this is not an error, as in the design of the app, this might occur quite frequently. (Actually, in the first iteration of the NcuWiki front, when this code was encountered, the home page was displayed instead.)
When it is a 200 code, the response body will look something like:
{
"markdown": "[link]: ?Page\nMarkdown content ....."
}