-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: refining the project and adding a qr-code api
- Loading branch information
1 parent
d33636a
commit 214b34b
Showing
9 changed files
with
131 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2024 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,43 @@ | ||
# Fresh project | ||
# sl-utils | ||
|
||
Your new Fresh project is ready to go. You can follow the Fresh "Getting | ||
Started" guide here: https://fresh.deno.dev/docs/getting-started | ||
> A small collection of utilities for myself 🤓 | ||
### Usage | ||
https://sl-utils.deno.dev/ | ||
|
||
Make sure to install Deno: https://deno.land/manual/getting_started/installation | ||
Some simple and small APIs to make my life easier. | ||
|
||
Then start the project: | ||
## Tech stack | ||
|
||
Built on top of: | ||
|
||
- [Deno](https://deno.land/) - Typescript native runtime | ||
- [Fresh](https://fresh.deno.dev/) - 1st party Web framework | ||
|
||
and some modules: | ||
|
||
- [qrcode](https://jsr.io/@libs/qrcode) | ||
|
||
published on [Deno Deploy](https://deno.com/deploy) free tier. | ||
|
||
## How to use | ||
|
||
Make sure to install Deno on your machine: https://deno.land/manual/getting_started/installation | ||
|
||
Then, clone the repository: | ||
|
||
``` | ||
deno task start | ||
$ git clone https://github.com/salvatorelaisa/sl-utils.git | ||
$ cd sl-utils | ||
``` | ||
|
||
Start the project: | ||
|
||
``` | ||
$ deno task start | ||
``` | ||
|
||
This will watch the project directory and restart as necessary. | ||
|
||
## License | ||
|
||
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
export const Footer = () => { | ||
return ( | ||
<footer> | ||
<p class="text-xs text-gray-600"> | ||
Made with ❤️ by{" "} | ||
<a | ||
class="underline text-blue-500" | ||
href="https://github.com/moebiusmania" | ||
> | ||
Salvatore Laisa | ||
</a>{" "} | ||
<span class="text-gray-600">·</span>{" "} | ||
<a | ||
class="underline text-blue-500" | ||
href="https://github.com/moebiusmania/sl-utils" | ||
> | ||
Source Code | ||
</a> | ||
</p> | ||
</footer> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
export const Hero = () => { | ||
return ( | ||
<> | ||
<figure class="overflow-hidden mb-4"> | ||
<img | ||
src="sl.png" | ||
alt="" | ||
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 🤓 | ||
</p> | ||
</> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { qrcode } from "@libs/qrcode"; | ||
|
||
export const handler = (_req: Request): Response => { | ||
const { searchParams } = new URL(_req.url); | ||
const url = searchParams.get("url"); | ||
|
||
if (!url) { | ||
return new Response( | ||
"URL is required: add '?url=<url> in the address bar'", | ||
{ status: 400 }, | ||
); | ||
} | ||
|
||
const qr = qrcode(url, { output: "svg" }); | ||
return new Response(qr, { | ||
headers: { "Content-Type": "image/svg+xml" }, | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters