From b3cc39788cf2472c5682a38e2497d439e5ae43b6 Mon Sep 17 00:00:00 2001 From: Arnold Cubici-Jones Date: Fri, 11 Oct 2024 12:11:26 +0100 Subject: [PATCH] feat(repo): update base url and mentions of .io variant to .com variant, gitignore .idea config for jetbrains IDE --- .gitignore | 3 ++- README.md | 4 ++-- src/index.test.ts | 8 ++++---- src/index.ts | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index db4c6d9..a284d13 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ dist -node_modules \ No newline at end of file +node_modules +.idea diff --git a/README.md b/README.md index c0add65..7168dac 100644 --- a/README.md +++ b/README.md @@ -27,12 +27,12 @@ const options = { }; const imgUrl = urlbox.generateRenderLink(options); -// https://api.urlbox.io/v1/YOUR_API_KEY/TOKEN/jpg?url=github.com&thumb_width=600&quality=80 +// https://api.urlbox.com/v1/YOUR_API_KEY/TOKEN/jpg?url=github.com&thumb_width=600&quality=80 ``` Now stick that url in an img tag to render the screenshot! -![Urlbox Screenshot of github.com](https://api.urlbox.io/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/5a9a56f05cf1229bd8f2edf4a0e6c218ccea1bb7/jpeg?url=github.com&thumb_width=600&quality=80) +![Urlbox Screenshot of github.com](https://api.urlbox.com/v1/ca482d7e-9417-4569-90fe-80f7c5e1c781/5a9a56f05cf1229bd8f2edf4a0e6c218ccea1bb7/jpeg?url=github.com&thumb_width=600&quality=80) Available options: diff --git a/src/index.test.ts b/src/index.test.ts index b3372d1..ddb480b 100644 --- a/src/index.test.ts +++ b/src/index.test.ts @@ -7,7 +7,7 @@ import { RenderOptions } from "types"; const myapikey = "MY_API_KEY"; const mysecret = "secret"; -const prefix = "https://api.urlbox.io/v1/"; +const prefix = "https://api.urlbox.com/v1/"; const urlbox = urlboxFactory(myapikey, mysecret); const toQuery = (options: RenderOptions) => @@ -29,7 +29,7 @@ test("should return a url with a valid token and query string", () => { .update(query) .digest("hex"); expect(renderLink).toEqual( - "https://api.urlbox.io/v1/" + myapikey + "/" + token + "/png?" + query + "https://api.urlbox.com/v1/" + myapikey + "/" + token + "/png?" + query ); }); test("should return a url with a valid token and query string with width param", () => { @@ -169,7 +169,7 @@ test("removes false values from query", () => { .digest("hex"); expect(renderLink).toEqual( - "https://api.urlbox.io/v1/" + myapikey + "/" + token + "/png?" + query + "https://api.urlbox.com/v1/" + myapikey + "/" + token + "/png?" + query ); }); test("removes 0 values from query", () => { @@ -188,7 +188,7 @@ test("removes 0 values from query", () => { .digest("hex"); expect(renderLink).toEqual( - "https://api.urlbox.io/v1/" + myapikey + "/" + token + "/png?" + query + "https://api.urlbox.com/v1/" + myapikey + "/" + token + "/png?" + query ); }); test("kitchen sink", () => { diff --git a/src/index.ts b/src/index.ts index f197972..20d03cf 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,7 +3,7 @@ import qs from "qs"; import { createHmac } from "node:crypto"; import { RenderOptions } from "./types"; -const DEFAULT_PREFIX = "https://api.urlbox.io/v1/"; +const DEFAULT_PREFIX = "https://api.urlbox.com/v1/"; const DEFAULT_OPTIONS = { format: "png", };