Files
services/examples/url/shorten/node/shortenALongUrl.js
2021-09-16 12:52:36 +01:00

13 lines
365 B
JavaScript
Executable File

import * as url from "m3o/url";
// Shortens a destination URL and returns a full short URL.
async function ShortenAlongUrl() {
let urlService = new url.UrlService(process.env.MICRO_API_TOKEN);
let rsp = await urlService.shorten({
destinationURL: "https://mysite.com/this-is-a-rather-long-web-address",
});
console.log(rsp);
}
await ShortenAlongUrl();