https://runkit.com/docs/endpoint
exports.endpoint = function(request, response) {
response.end("Hello world!");
}
curl https://gukz57faao6o.runkit.sh
Every RunKit Notebook has a main url like:
https://runkit.com/runkit/endpoint-demo-1
as well as specific revision URLs like:
https://runkit.com/runkit/endpoint-demo-1/branches/master
https://runkit.com/runkit/endpoint-demo-1/1.0.0
Notebooks access through endpoint are hosted on runkit.io and each user has their own subdomain. Unlike the main notebook page, which has a shorthand for accessing the latest revision, you'll just need to specifically reference /branches/master. Being explicit has an advantage; it means that not only will your notebook respond to urls like:
https://runkit.runkit.io/endpoint-demo-1/branches/master
It also responds to any sub-paths like these:
https://runkit.runkit.io/endpoint-demo-1/branches/master/hello/world
https://runkit.runkit.io/endpoint-demo-1/branches/master/use/the/force
You can use the environment variable process.env.RUNKIT_MOUNT_PATH
to programatically check the base path of your endpoint,
and process.env.RUNKIT_ENDPOINT_URL
to get the base URL of your endpoint.