mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-19 14:05:23 +00:00
Generate clients (#206)
This commit is contained in:
12
examples/url/shorten/node/shortenALongUrl.js
Executable file
12
examples/url/shorten/node/shortenALongUrl.js
Executable file
@@ -0,0 +1,12 @@
|
||||
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();
|
||||
Reference in New Issue
Block a user