Skip to content

Commit

Permalink
feat: adding another endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
moebiusmania committed Nov 16, 2024
1 parent 2165739 commit 09b7fad
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# sl-utils

> A small collection of utilities for myself 🤓
> 🛠️ A small collection of utilities for myself 🤓
https://sl-utils.deno.dev/

Expand Down
4 changes: 2 additions & 2 deletions components/Hero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ export const Hero = () => {
<figure class="overflow-hidden mb-4">
<img
src="sl.png"
alt=""
alt="my pixel-art avatar"
class="w-24 h-24 object-cover border border-gray-300 rounded-full mx-auto"
/>
</figure>
<h1 class="text-4xl md:text-5xl font-bold mb-4">
sl-utils
</h1>
<p class="text-lg md:text-xl text-gray-600">
A small collection of utilities for myself 🤓
🛠️ A small collection of utilities for myself 🤓
</p>
</>
);
Expand Down
2 changes: 2 additions & 0 deletions fresh.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import * as $_404 from "./routes/_404.tsx";
import * as $_app from "./routes/_app.tsx";
import * as $api_mit_license from "./routes/api/mit-license.ts";
import * as $api_password from "./routes/api/password.ts";
import * as $api_qr_code from "./routes/api/qr-code.ts";
import * as $greet_name_ from "./routes/greet/[name].tsx";
Expand All @@ -15,6 +16,7 @@ const manifest = {
routes: {
"./routes/_404.tsx": $_404,
"./routes/_app.tsx": $_app,
"./routes/api/mit-license.ts": $api_mit_license,
"./routes/api/password.ts": $api_password,
"./routes/api/qr-code.ts": $api_qr_code,
"./routes/greet/[name].tsx": $greet_name_,
Expand Down
2 changes: 1 addition & 1 deletion routes/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default function App({ Component }: PageProps) {
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>sl-utils</title>
<title>🛠️ sl-utils</title>
<link rel="stylesheet" href="/styles.css" />
<link rel="icon" href="/sl.png" />
</head>
Expand Down
27 changes: 27 additions & 0 deletions routes/api/mit-license.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
export const handler = (_req: Request): Response => {
const year = new Date().getFullYear();
return new Response(
`MIT License
Copyright (c) ${year} Salvatore Laisa
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.`,
{ status: 200, headers: { "Content-Type": "text/plain" } },
);
};
5 changes: 5 additions & 0 deletions routes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ const data = [
methods: "GET",
description: "Create a QR code for a given URL",
},
{
endpoint: "/api/mit-license",
methods: "GET",
description: "Precompiled MIT License text",
},
];

export default function Home() {
Expand Down

0 comments on commit 09b7fad

Please sign in to comment.