princejs 1.8.0 → 1.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Readme.md +5 -1
- package/package.json +1 -1
package/Readme.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# 👑 **PrinceJS**
|
|
2
2
|
|
|
3
|
+

|
|
4
|
+
|
|
3
5
|
### ⚡ Ultra-clean, modern & minimal Bun web framework built by a 13 year old. Among the top three in performance.
|
|
4
6
|
|
|
5
7
|

|
|
@@ -96,7 +98,7 @@ app
|
|
|
96
98
|
|
|
97
99
|
```ts
|
|
98
100
|
import { prince } from "princejs";
|
|
99
|
-
import { cors, logger, rateLimit, auth, apiKey, jwt, session, compress } from "princejs/middleware";
|
|
101
|
+
import { cors, logger, rateLimit, auth, apiKey, jwt, session, compress, serve } from "princejs/middleware";
|
|
100
102
|
import { validate } from "princejs/validation";
|
|
101
103
|
import { cache, upload, sse } from "princejs/helpers";
|
|
102
104
|
import { cron } from "princejs/scheduler";
|
|
@@ -110,6 +112,8 @@ app.use(cors());
|
|
|
110
112
|
app.use(logger());
|
|
111
113
|
app.use(rateLimit({ max: 100, window: 60 }));
|
|
112
114
|
|
|
115
|
+
app.use(serve({ root: "./public" }));
|
|
116
|
+
|
|
113
117
|
app.use(validate(z.object({ name: z.string() })));
|
|
114
118
|
|
|
115
119
|
app.use(jwt(key));
|
package/package.json
CHANGED