Skip to content

Instantly share code, notes, and snippets.

@estiller

estiller/index.js

Created Jul 9, 2020
Embed
What would you like to do?
Building a Custom URL Shortener Using Azure Functions and Cosmos DB - Adding the URL Redirect Endpoint
module.exports = async function (context, req, registration) {
context.log("Url redirect triggered");
if (registration) {
return {
res: {
status: 302,
headers: {
Location: registration.url,
},
},
};
}
return { res: { status: 404 } };
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.