Monorepo for wisp.place. A static site hosting service built on top of the AT Protocol. wisp.place

:tada: feat: init

nekomimi.pet b09f398c

+44
.gitignore
··· 1 + # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 + 3 + # dependencies 4 + /node_modules 5 + /.pnp 6 + .pnp.js 7 + 8 + # testing 9 + /coverage 10 + 11 + # next.js 12 + /.next/ 13 + /out/ 14 + 15 + # production 16 + /build 17 + 18 + # misc 19 + .DS_Store 20 + *.pem 21 + 22 + # debug 23 + npm-debug.log* 24 + yarn-debug.log* 25 + yarn-error.log* 26 + 27 + # local env files 28 + .env.local 29 + .env.development.local 30 + .env.test.local 31 + .env.production.local 32 + 33 + # vercel 34 + .vercel 35 + 36 + **/*.trace 37 + **/*.zip 38 + **/*.tar.gz 39 + **/*.tgz 40 + **/*.log 41 + package-lock.json 42 + **/*.bun 43 + 44 + server
+7
.prettierrc
··· 1 + { 2 + "useTabs": true, 3 + "tabWidth": 4, 4 + "semi": false, 5 + "singleQuote": true, 6 + "trailingComma": "none" 7 + }
+15
README.md
··· 1 + # Elysia with Bun runtime 2 + 3 + ## Getting Started 4 + To get started with this template, simply paste this command into your terminal: 5 + ```bash 6 + bun create elysia ./elysia-example 7 + ``` 8 + 9 + ## Development 10 + To start the development server run: 11 + ```bash 12 + bun run dev 13 + ``` 14 + 15 + Open http://localhost:3000/ with your browser to see the result.
+118
bun.lock
··· 1 + { 2 + "lockfileVersion": 1, 3 + "workspaces": { 4 + "": { 5 + "name": "elysia-static", 6 + "dependencies": { 7 + "@elysiajs/eden": "^1.4.3", 8 + "@elysiajs/openapi": "^1.4.11", 9 + "@elysiajs/static": "^1.4.2", 10 + "@tanstack/react-query": "^5.90.2", 11 + "clsx": "^2.1.1", 12 + "elysia": "latest", 13 + "react": "^19.2.0", 14 + "react-dom": "^19.2.0", 15 + "tailwindcss": "^4.1.14", 16 + }, 17 + "devDependencies": { 18 + "@types/react": "^19.2.2", 19 + "@types/react-dom": "^19.2.1", 20 + "bun-plugin-tailwind": "^0.1.2", 21 + "bun-types": "latest", 22 + }, 23 + }, 24 + }, 25 + "packages": { 26 + "@borewit/text-codec": ["@borewit/text-codec@0.1.1", "", {}, "sha512-5L/uBxmjaCIX5h8Z+uu+kA9BQLkc/Wl06UGR5ajNRxu+/XjonB5i8JpgFMrPj3LXTCPA0pv8yxUvbUi+QthGGA=="], 27 + 28 + "@elysiajs/eden": ["@elysiajs/eden@1.4.3", "", { "peerDependencies": { "elysia": ">= 1.4.0-exp.0" } }, "sha512-mX0v5cTvTJiDsDWNEEyuoqudOvW5J+tXsvp/ZOJXJF3iCIEJI0Brvm78ymPrvwiOG4nUr3lS8BxUfbNf32DSXA=="], 29 + 30 + "@elysiajs/openapi": ["@elysiajs/openapi@1.4.11", "", { "peerDependencies": { "elysia": ">= 1.4.0" } }, "sha512-d75bMxYJpN6qSDi/z9L1S7SLk1S/8Px+cTb3W2lrYzU8uQ5E0kXdy1oOMJEfTyVsz3OA19NP9KNxE7ztSbLBLg=="], 31 + 32 + "@elysiajs/static": ["@elysiajs/static@1.4.2", "", { "peerDependencies": { "elysia": ">= 1.4.0" } }, "sha512-lAEvdxeBhU/jX/hTzfoP+1AtqhsKNCwW4Q+tfNwAShWU6s4ZPQxR1hLoHBveeApofJt4HWEq/tBGvfFz3ODuKg=="], 33 + 34 + "@oven/bun-darwin-aarch64": ["@oven/bun-darwin-aarch64@1.3.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-WeXSaL29ylJEZMYHHW28QZ6rgAbxQ1KuNSZD9gvd3fPlo0s6s2PglvPArjjP07nmvIK9m4OffN0k4M98O7WmAg=="], 35 + 36 + "@oven/bun-darwin-x64": ["@oven/bun-darwin-x64@1.3.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-CFKjoUWQH0Oz3UHYfKbdKLq0wGryrFsTJEYq839qAwHQSECvVZYAnxVVDYUDa0yQFonhO2qSHY41f6HK+b7xtw=="], 37 + 38 + "@oven/bun-darwin-x64-baseline": ["@oven/bun-darwin-x64-baseline@1.3.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-+FSr/ub5vA/EkD3fMhHJUzYioSf/sXd50OGxNDAntVxcDu4tXL/81Ka3R/gkZmjznpLFIzovU/1Ts+b7dlkrfw=="], 39 + 40 + "@oven/bun-linux-aarch64": ["@oven/bun-linux-aarch64@1.3.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-WHthS/eLkCNcp9pk4W8aubRl9fIUgt2XhHyLrP0GClB1FVvmodu/zIOtG0NXNpzlzB8+gglOkGo4dPjfVf4Z+g=="], 41 + 42 + "@oven/bun-linux-aarch64-musl": ["@oven/bun-linux-aarch64-musl@1.3.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-HT5sr7N8NDYbQRjAnT7ISpx64y+ewZZRQozOJb0+KQObKvg4UUNXGm4Pn1xA4/WPMZDDazjO8E2vtOQw1nJlAQ=="], 43 + 44 + "@oven/bun-linux-x64": ["@oven/bun-linux-x64@1.3.0", "", { "os": "linux", "cpu": "x64" }, "sha512-sGEWoJQXO4GDr0x4t/yJQ/Bq1yNkOdX9tHbZZ+DBGJt3z3r7jeb4Digv8xQUk6gdTFC9vnGHuin+KW3/yD1Aww=="], 45 + 46 + "@oven/bun-linux-x64-baseline": ["@oven/bun-linux-x64-baseline@1.3.0", "", { "os": "linux", "cpu": "x64" }, "sha512-OmlEH3nlxQyv7HOvTH21vyNAZGv9DIPnrTznzvKiOQxkOphhCyKvPTlF13ydw4s/i18iwaUrhHy+YG9HSSxa4Q=="], 47 + 48 + "@oven/bun-linux-x64-musl": ["@oven/bun-linux-x64-musl@1.3.0", "", { "os": "linux", "cpu": "x64" }, "sha512-rtzUEzCynl3Rhgn/iR9DQezSFiZMcAXAbU+xfROqsweMGKwvwIA2ckyyckO08psEP8XcUZTs3LT9CH7PnaMiEA=="], 49 + 50 + "@oven/bun-linux-x64-musl-baseline": ["@oven/bun-linux-x64-musl-baseline@1.3.0", "", { "os": "linux", "cpu": "x64" }, "sha512-hrr7mDvUjMX1tuJaXz448tMsgKIqGJBY8+rJqztKOw1U5+a/v2w5HuIIW1ce7ut0ZwEn+KIDvAujlPvpH33vpQ=="], 51 + 52 + "@oven/bun-windows-x64": ["@oven/bun-windows-x64@1.3.0", "", { "os": "win32", "cpu": "x64" }, "sha512-xXwtpZVVP7T+vkxcF/TUVVOGRjEfkByO4mKveKYb4xnHWV4u4NnV0oNmzyMKkvmj10to5j2h0oZxA4ZVVv4gfA=="], 53 + 54 + "@oven/bun-windows-x64-baseline": ["@oven/bun-windows-x64-baseline@1.3.0", "", { "os": "win32", "cpu": "x64" }, "sha512-/jVZ8eYjpYHLDFNoT86cP+AjuWvpkzFY+0R0a1bdeu0sQ6ILuy1FV6hz1hUAP390E09VCo5oP76fnx29giHTtA=="], 55 + 56 + "@sinclair/typebox": ["@sinclair/typebox@0.34.41", "", {}, "sha512-6gS8pZzSXdyRHTIqoqSVknxolr1kzfy4/CeDnrzsVz8TTIWUbOBr6gnzOmTYJ3eXQNh4IYHIGi5aIL7sOZ2G/g=="], 57 + 58 + "@tanstack/query-core": ["@tanstack/query-core@5.90.2", "", {}, "sha512-k/TcR3YalnzibscALLwxeiLUub6jN5EDLwKDiO7q5f4ICEoptJ+n9+7vcEFy5/x/i6Q+Lb/tXrsKCggf5uQJXQ=="], 59 + 60 + "@tanstack/react-query": ["@tanstack/react-query@5.90.2", "", { "dependencies": { "@tanstack/query-core": "5.90.2" }, "peerDependencies": { "react": "^18 || ^19" } }, "sha512-CLABiR+h5PYfOWr/z+vWFt5VsOA2ekQeRQBFSKlcoW6Ndx/f8rfyVmq4LbgOM4GG2qtxAxjLYLOpCNTYm4uKzw=="], 61 + 62 + "@tokenizer/inflate": ["@tokenizer/inflate@0.2.7", "", { "dependencies": { "debug": "^4.4.0", "fflate": "^0.8.2", "token-types": "^6.0.0" } }, "sha512-MADQgmZT1eKjp06jpI2yozxaU9uVs4GzzgSL+uEq7bVcJ9V1ZXQkeGNql1fsSI0gMy1vhvNTNbUqrx+pZfJVmg=="], 63 + 64 + "@tokenizer/token": ["@tokenizer/token@0.3.0", "", {}, "sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A=="], 65 + 66 + "@types/node": ["@types/node@24.7.2", "", { "dependencies": { "undici-types": "~7.14.0" } }, "sha512-/NbVmcGTP+lj5oa4yiYxxeBjRivKQ5Ns1eSZeB99ExsEQ6rX5XYU1Zy/gGxY/ilqtD4Etx9mKyrPxZRetiahhA=="], 67 + 68 + "@types/react": ["@types/react@19.2.2", "", { "dependencies": { "csstype": "^3.0.2" } }, "sha512-6mDvHUFSjyT2B2yeNx2nUgMxh9LtOWvkhIU3uePn2I2oyNymUAX1NIsdgviM4CH+JSrp2D2hsMvJOkxY+0wNRA=="], 69 + 70 + "@types/react-dom": ["@types/react-dom@19.2.1", "", { "peerDependencies": { "@types/react": "^19.2.0" } }, "sha512-/EEvYBdT3BflCWvTMO7YkYBHVE9Ci6XdqZciZANQgKpaiDRGOLIlRo91jbTNRQjgPFWVaRxcYc0luVNFitz57A=="], 71 + 72 + "bun": ["bun@1.3.0", "", { "optionalDependencies": { "@oven/bun-darwin-aarch64": "1.3.0", "@oven/bun-darwin-x64": "1.3.0", "@oven/bun-darwin-x64-baseline": "1.3.0", "@oven/bun-linux-aarch64": "1.3.0", "@oven/bun-linux-aarch64-musl": "1.3.0", "@oven/bun-linux-x64": "1.3.0", "@oven/bun-linux-x64-baseline": "1.3.0", "@oven/bun-linux-x64-musl": "1.3.0", "@oven/bun-linux-x64-musl-baseline": "1.3.0", "@oven/bun-windows-x64": "1.3.0", "@oven/bun-windows-x64-baseline": "1.3.0" }, "os": [ "linux", "win32", "darwin", ], "cpu": [ "x64", "arm64", ], "bin": { "bun": "bin/bun.exe", "bunx": "bin/bunx.exe" } }, "sha512-YI7mFs7iWc/VsGsh2aw6eAPD2cjzn1j+LKdYVk09x1CrdTWKYIHyd+dG5iQoN9//3hCDoZj8U6vKpZzEf5UARA=="], 73 + 74 + "bun-plugin-tailwind": ["bun-plugin-tailwind@0.1.2", "", { "peerDependencies": { "bun": ">=1.0.0" } }, "sha512-41jNC1tZRSK3s1o7pTNrLuQG8kL/0vR/JgiTmZAJ1eHwe0w5j6HFPKeqEk0WAD13jfrUC7+ULuewFBBCoADPpg=="], 75 + 76 + "bun-types": ["bun-types@1.3.0", "", { "dependencies": { "@types/node": "*" }, "peerDependencies": { "@types/react": "^19" } }, "sha512-u8X0thhx+yJ0KmkxuEo9HAtdfgCBaM/aI9K90VQcQioAmkVp3SG3FkwWGibUFz3WdXAdcsqOcbU40lK7tbHdkQ=="], 77 + 78 + "clsx": ["clsx@2.1.1", "", {}, "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA=="], 79 + 80 + "cookie": ["cookie@1.0.2", "", {}, "sha512-9Kr/j4O16ISv8zBBhJoi4bXOYNTkFLOqSL3UDB0njXxCXNezjeyVrJyGOWtgfs/q2km1gwBcfH8q1yEGoMYunA=="], 81 + 82 + "csstype": ["csstype@3.1.3", "", {}, "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw=="], 83 + 84 + "debug": ["debug@4.4.3", "", { "dependencies": { "ms": "^2.1.3" } }, "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA=="], 85 + 86 + "elysia": ["elysia@1.4.11", "", { "dependencies": { "cookie": "^1.0.2", "exact-mirror": "0.2.2", "fast-decode-uri-component": "^1.0.1" }, "peerDependencies": { "@sinclair/typebox": ">= 0.34.0 < 1", "file-type": ">= 20.0.0", "openapi-types": ">= 12.0.0", "typescript": ">= 5.0.0" }, "optionalPeers": ["typescript"] }, "sha512-cphuzQj0fRw1ICRvwHy2H3xQio9bycaZUVHnDHJQnKqBfMNlZ+Hzj6TMmt9lc0Az0mvbCnPXWVF7y1MCRhUuOA=="], 87 + 88 + "exact-mirror": ["exact-mirror@0.2.2", "", { "peerDependencies": { "@sinclair/typebox": "^0.34.15" }, "optionalPeers": ["@sinclair/typebox"] }, "sha512-CrGe+4QzHZlnrXZVlo/WbUZ4qQZq8C0uATQVGVgXIrNXgHDBBNFD1VRfssRA2C9t3RYvh3MadZSdg2Wy7HBoQA=="], 89 + 90 + "fast-decode-uri-component": ["fast-decode-uri-component@1.0.1", "", {}, "sha512-WKgKWg5eUxvRZGwW8FvfbaH7AXSh2cL+3j5fMGzUMCxWBJ3dV3a7Wz8y2f/uQ0e3B6WmodD3oS54jTQ9HVTIIg=="], 91 + 92 + "fflate": ["fflate@0.8.2", "", {}, "sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A=="], 93 + 94 + "file-type": ["file-type@21.0.0", "", { "dependencies": { "@tokenizer/inflate": "^0.2.7", "strtok3": "^10.2.2", "token-types": "^6.0.0", "uint8array-extras": "^1.4.0" } }, "sha512-ek5xNX2YBYlXhiUXui3D/BXa3LdqPmoLJ7rqEx2bKJ7EAUEfmXgW0Das7Dc6Nr9MvqaOnIqiPV0mZk/r/UpNAg=="], 95 + 96 + "ieee754": ["ieee754@1.2.1", "", {}, "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA=="], 97 + 98 + "ms": ["ms@2.1.3", "", {}, "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="], 99 + 100 + "openapi-types": ["openapi-types@12.1.3", "", {}, "sha512-N4YtSYJqghVu4iek2ZUvcN/0aqH1kRDuNqzcycDxhOUpg7GdvLa2F3DgS6yBNhInhv2r/6I0Flkn7CqL8+nIcw=="], 101 + 102 + "react": ["react@19.2.0", "", {}, "sha512-tmbWg6W31tQLeB5cdIBOicJDJRR2KzXsV7uSK9iNfLWQ5bIZfxuPEHp7M8wiHyHnn0DD1i7w3Zmin0FtkrwoCQ=="], 103 + 104 + "react-dom": ["react-dom@19.2.0", "", { "dependencies": { "scheduler": "^0.27.0" }, "peerDependencies": { "react": "^19.2.0" } }, "sha512-UlbRu4cAiGaIewkPyiRGJk0imDN2T3JjieT6spoL2UeSf5od4n5LB/mQ4ejmxhCFT1tYe8IvaFulzynWovsEFQ=="], 105 + 106 + "scheduler": ["scheduler@0.27.0", "", {}, "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q=="], 107 + 108 + "strtok3": ["strtok3@10.3.4", "", { "dependencies": { "@tokenizer/token": "^0.3.0" } }, "sha512-KIy5nylvC5le1OdaaoCJ07L+8iQzJHGH6pWDuzS+d07Cu7n1MZ2x26P8ZKIWfbK02+XIL8Mp4RkWeqdUCrDMfg=="], 109 + 110 + "tailwindcss": ["tailwindcss@4.1.14", "", {}, "sha512-b7pCxjGO98LnxVkKjaZSDeNuljC4ueKUddjENJOADtubtdo8llTaJy7HwBMeLNSSo2N5QIAgklslK1+Ir8r6CA=="], 111 + 112 + "token-types": ["token-types@6.1.1", "", { "dependencies": { "@borewit/text-codec": "^0.1.0", "@tokenizer/token": "^0.3.0", "ieee754": "^1.2.1" } }, "sha512-kh9LVIWH5CnL63Ipf0jhlBIy0UsrMj/NJDfpsy1SqOXlLKEVyXXYrnFxFT1yOOYVGBSApeVnjPw/sBz5BfEjAQ=="], 113 + 114 + "uint8array-extras": ["uint8array-extras@1.5.0", "", {}, "sha512-rvKSBiC5zqCCiDZ9kAOszZcDvdAHwwIKJG33Ykj43OKcWsnmcBRL09YTU4nOeHZ8Y2a7l1MgTd08SBe9A8Qj6A=="], 115 + 116 + "undici-types": ["undici-types@7.14.0", "", {}, "sha512-QQiYxHuyZ9gQUIrmPo3IA+hUl4KYk8uSA7cHrcKd/l3p1OTpZcM0Tbp9x7FAtXdAYhlasd60ncPpgu6ihG6TOA=="], 117 + } 118 + }
+2
bunfig.toml
··· 1 + [serve.static] 2 + plugins = ["bun-plugin-tailwind"]
+27
package.json
··· 1 + { 2 + "name": "elysia-static", 3 + "version": "1.0.50", 4 + "scripts": { 5 + "test": "echo \"Error: no test specified\" && exit 1", 6 + "dev": "bun run --watch src/index.ts", 7 + "build": "bun build --compile --target bun --outfile server src/index.ts" 8 + }, 9 + "dependencies": { 10 + "@elysiajs/eden": "^1.4.3", 11 + "@elysiajs/openapi": "^1.4.11", 12 + "@elysiajs/static": "^1.4.2", 13 + "@tanstack/react-query": "^5.90.2", 14 + "clsx": "^2.1.1", 15 + "elysia": "latest", 16 + "react": "^19.2.0", 17 + "react-dom": "^19.2.0", 18 + "tailwindcss": "^4.1.14" 19 + }, 20 + "devDependencies": { 21 + "@types/react": "^19.2.2", 22 + "@types/react-dom": "^19.2.1", 23 + "bun-plugin-tailwind": "^0.1.2", 24 + "bun-types": "latest" 25 + }, 26 + "module": "src/index.js" 27 + }
public/images/maddelena-1.webp

This is a binary file and will not be displayed.

public/images/maddelena-2.webp

This is a binary file and will not be displayed.

+13
public/index.html
··· 1 + <!doctype html> 2 + <html lang="en"> 3 + <head> 4 + <meta charset="UTF-8" /> 5 + 6 + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> 7 + <title>Elysia Static</title> 8 + </head> 9 + <body> 10 + <div id="elysia"></div> 11 + <script type="module" src="./index.tsx"></script> 12 + </body> 13 + </html>
+30
public/index.tsx
··· 1 + import { useState } from 'react' 2 + import { createRoot } from 'react-dom/client' 3 + 4 + import Layout from './layouts' 5 + 6 + function App() { 7 + const [count, setCount] = useState(0) 8 + const increase = () => setCount((c) => c + 1) 9 + 10 + return ( 11 + <> 12 + <img src="/images/maddelena-1.webp" className="max-w-40" /> 13 + <h1 className="text-3xl">Bun/Elysia Fullstack</h1> 14 + <h2 className="text-6xl">{count}</h2> 15 + <button 16 + className="text-xl text-blue-500 px-6 py-2 bg-blue-100 rounded-xl" 17 + onClick={increase} 18 + > 19 + Increase 20 + </button> 21 + </> 22 + ) 23 + } 24 + 25 + const root = createRoot(document.getElementById('elysia')!) 26 + root.render( 27 + <Layout className="gap-6"> 28 + <App /> 29 + </Layout> 30 + )
+27
public/layouts/index.tsx
··· 1 + import type { PropsWithChildren } from 'react' 2 + 3 + import { QueryClientProvider, QueryClient } from '@tanstack/react-query' 4 + import clsx from 'clsx' 5 + 6 + import '../styles/global.css' 7 + 8 + const client = new QueryClient() 9 + 10 + interface LayoutProps extends PropsWithChildren { 11 + className?: string 12 + } 13 + 14 + export default function Layout({ children, className }: LayoutProps) { 15 + return ( 16 + <QueryClientProvider client={client}> 17 + <div 18 + className={clsx( 19 + 'flex flex-col justify-center items-center w-full min-h-screen', 20 + className 21 + )} 22 + > 23 + {children} 24 + </div> 25 + </QueryClientProvider> 26 + ) 27 + }
+5
public/libs/api.ts
··· 1 + import { treaty } from '@elysiajs/eden' 2 + 3 + import type { app } from '../../src' 4 + 5 + export const api = treaty<typeof app>('localhost:3000')
+13
public/other/index.html
··· 1 + <!doctype html> 2 + <html lang="en"> 3 + <head> 4 + <meta charset="UTF-8" /> 5 + 6 + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> 7 + <title>Elysia Static</title> 8 + </head> 9 + <body> 10 + <div id="elysia"></div> 11 + <script type="module" src="./index.tsx"></script> 12 + </body> 13 + </html>
+27
public/other/index.tsx
··· 1 + import { createRoot } from 'react-dom/client' 2 + import { useQuery } from '@tanstack/react-query' 3 + 4 + import Layout from '../layouts' 5 + import { api } from '../libs/api' 6 + 7 + function App() { 8 + const { data: response, isLoading } = useQuery({ 9 + queryKey: ['version'], 10 + queryFn: () => api.message.get() 11 + }) 12 + 13 + return ( 14 + <> 15 + <img src="/images/maddelena-2.webp" className="max-w-40" /> 16 + <h1 className="text-3xl">API call!</h1> 17 + <h2 className="text-6xl">{response?.data?.message}</h2> 18 + </> 19 + ) 20 + } 21 + 22 + const root = createRoot(document.getElementById('elysia')!) 23 + root.render( 24 + <Layout className="gap-6"> 25 + <App /> 26 + </Layout> 27 + )
+1
public/styles/global.css
··· 1 + @import 'tailwindcss';
+21
src/index.ts
··· 1 + import { Elysia } from 'elysia' 2 + import { staticPlugin } from '@elysiajs/static' 3 + import { openapi, fromTypes } from '@elysiajs/openapi' 4 + 5 + export const app = new Elysia() 6 + .use( 7 + openapi({ 8 + references: fromTypes() 9 + }) 10 + ) 11 + .use( 12 + await staticPlugin({ 13 + prefix: '/' 14 + }) 15 + ) 16 + .get('/message', { message: 'Hello from server' } as const) 17 + .listen(3000) 18 + 19 + console.log( 20 + `🦊 Elysia is running at ${app.server?.hostname}:${app.server?.port}` 21 + )
+105
tsconfig.json
··· 1 + { 2 + "compilerOptions": { 3 + /* Visit https://aka.ms/tsconfig to read more about this file */ 4 + 5 + /* Projects */ 6 + // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ 7 + // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ 8 + // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ 9 + // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ 10 + // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ 11 + // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ 12 + 13 + /* Language and Environment */ 14 + "target": "ES2021" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */, 15 + // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ 16 + "jsx": "preserve" /* Specify what JSX code is generated. */, 17 + // "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */ 18 + // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ 19 + // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ 20 + // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ 21 + // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ 22 + // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ 23 + // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ 24 + // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ 25 + // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ 26 + 27 + /* Modules */ 28 + "module": "ES2022" /* Specify what module code is generated. */, 29 + // "rootDir": "./", /* Specify the root folder within your source files. */ 30 + "moduleResolution": "node" /* Specify how TypeScript looks up a file from a given module specifier. */, 31 + // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ 32 + // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ 33 + // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ 34 + // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ 35 + "types": [ 36 + "bun-types" 37 + ] /* Specify type package names to be included without being referenced in a source file. */, 38 + // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ 39 + // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ 40 + // "resolveJsonModule": true, /* Enable importing .json files. */ 41 + // "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */ 42 + 43 + /* JavaScript Support */ 44 + // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ 45 + // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ 46 + // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ 47 + 48 + /* Emit */ 49 + // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ 50 + // "declarationMap": true, /* Create sourcemaps for d.ts files. */ 51 + // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ 52 + // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ 53 + // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ 54 + // "outDir": "./", /* Specify an output folder for all emitted files. */ 55 + // "removeComments": true, /* Disable emitting comments. */ 56 + // "noEmit": true, /* Disable emitting files from a compilation. */ 57 + // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ 58 + // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */ 59 + // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ 60 + // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ 61 + // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ 62 + // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ 63 + // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ 64 + // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ 65 + // "newLine": "crlf", /* Set the newline character for emitting files. */ 66 + // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ 67 + // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ 68 + // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ 69 + // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ 70 + // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ 71 + // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ 72 + 73 + /* Interop Constraints */ 74 + // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ 75 + // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ 76 + "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */, 77 + // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ 78 + "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */, 79 + 80 + /* Type Checking */ 81 + "strict": true /* Enable all strict type-checking options. */, 82 + // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ 83 + // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ 84 + // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ 85 + // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ 86 + // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ 87 + // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ 88 + // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ 89 + // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ 90 + // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ 91 + // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ 92 + // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ 93 + // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ 94 + // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ 95 + // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ 96 + // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ 97 + // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ 98 + // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ 99 + // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ 100 + 101 + /* Completeness */ 102 + // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ 103 + "skipLibCheck": true /* Skip type checking all .d.ts files. */ 104 + } 105 + }