This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -v -X POST -H 'Content-Type: application/json' \ | |
-d '{ "url": "http://mydomain.com", "vanity": "shortname" }' \ | |
http://localhost:7071/register | |
curl -v -X GET http://localhost:7071/shortname |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -X POST -d "@./register/sample.dat" http://localhost:7071/api/register |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"extensions": { | |
"http": { | |
"routePrefix": "" | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Values": { | |
"RegistrationsDB": "AccountEndpoint=https://localhost:8081/;AccountKey=C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"bindings": [ | |
{ | |
"authLevel": "anonymous", | |
"type": "httpTrigger", | |
"direction": "in", | |
"name": "req", | |
"methods": ["get"], | |
"route": "{vanity}" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = async function (context, req, registration) { | |
context.log("Url redirect triggered"); | |
if (registration) { | |
return { | |
res: { | |
status: 302, | |
headers: { | |
Location: registration.url, | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = async function (context, req) { | |
context.log("Url registration triggered"); | |
if (req.body && req.body.url && req.body.vanity) { | |
return { | |
registration: { | |
id: req.body.vanity, | |
url: req.body.url, | |
}, | |
res: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"bindings": [ | |
{ | |
"authLevel": "anonymous", | |
"type": "httpTrigger", | |
"direction": "in", | |
"name": "req", | |
"methods": ["post"], | |
"route": "register" | |
}, |