-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
I was able to get the rest api up and running and the following url works in my browser:
http://127.0.0.1:1781/api/
If I add a custom endpoint, would it show up in that list of apis?
I tried making my settings:
"rest.api": {
"autoStart": true,
"openInBrowser": true,
"port": 1781,
"endpoints": {
"myendpoint": {
"script": "./my-endpoint.js",
"options": "Hello!"
}
}
},
And saving the example script you gave here: ( in the same folder as settings.json )
Should I be able to excecute it with:
http://127.0.0.1:1781/api/myendpoint
I'm not sure how I would debug this, or if it is possible my .js file is in the wrong spot, or invalid, or if I need special settings to allow executing a custom endpoint.
I will want to create a few custom endpoints like:
- get current line number ( where cursor position is )
- get current line text
- get current file name ( api/editor seems like a start but I think it might crash if the content of the file is too large )
I'm interested in learning how to write all of these but I think I need to get my "hello world" example going first :)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
