Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.
/ mijikee Public archive

A simple URL shortener with Deno KV

License

Notifications You must be signed in to change notification settings

ryuapp/mijikee

Repository files navigation

🌫Mijikee

A simple URL shortener with Deno KV.
Mijikee works on Deno Deploy.

📃 TOC

🚀 Getting started

Install Deno CLI v1.33.1 or higher.

🏡 Local

From within your project folder, start the development server using the deno task command.

deno task start

Now open http://localhost:8000 in your browser to view the page.

🌎 Internet

To deploy the project on Deno Deploy.

  1. Push your project to GitHub.
  2. Create a Deno Deploy project.
  3. Link the Deno Deploy project to the main.ts file in the root of the created repository.
  4. The project will be deployed to a public $project.deno.dev subdomain.

🤔 How to use

Save URL in KV by sending POST request to /api/v1/links.
And you can access the URL from :/shortPath.

🔱 Endpoints

GET: /

Response

Hello Mijikee!

GET: /:shortPath

Redirect to URL set in shortPath.

POST: /api/v1/links

Save URL in KV.

Form parameters

Name Type Description
url string need url starting with "https://"

Response

{
    message: "Short URL is created.",
    status: "ok",
    originUrl: "example.com",
    shortPath: "ExaMpLE"
}