@server/next 0.40.4 → 0.42.0
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/index.d.ts +150 -103
- package/index.js +433 -284
- package/package.json +15 -16
- package/readme.md +6 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@server/next",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.42.0",
|
|
4
4
|
"description": "A fully-fledged web server with routing, file uploads, sessions, static files, schema validation, websockets, testing, etc.",
|
|
5
5
|
"homepage": "https://server-js.com/",
|
|
6
6
|
"repository": "github:franciscop/server-next",
|
|
@@ -47,32 +47,31 @@
|
|
|
47
47
|
"Github": "https://github.com/franciscop/server-next"
|
|
48
48
|
},
|
|
49
49
|
"documentation": {
|
|
50
|
-
"Documentation":
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"Authentication": "docs/7. Authentication.md",
|
|
60
|
-
"Testing": "docs/8. Testing.md",
|
|
61
|
-
"Platforms": "docs/9. Platforms.md",
|
|
62
|
-
"FAQ": "docs/A. FAQ.md"
|
|
50
|
+
"Documentation": "docs/0. Documentation.md",
|
|
51
|
+
"Options": "docs/1. Options.md",
|
|
52
|
+
"Router": "docs/2. Router.md",
|
|
53
|
+
"Context": "docs/3. Context.md",
|
|
54
|
+
"Reply": "docs/4. Reply.md",
|
|
55
|
+
"Authentication": "docs/5. Authentication.md",
|
|
56
|
+
"Testing": "docs/6. Testing.md",
|
|
57
|
+
"Platforms": "docs/7. Platforms.md",
|
|
58
|
+
"FAQ": "docs/8. FAQ.md"
|
|
63
59
|
},
|
|
64
60
|
"tutorials": "docs/tutorials"
|
|
65
61
|
},
|
|
66
62
|
"dependencies": {
|
|
67
63
|
"bucket": "^0.7.1",
|
|
68
|
-
"polystore": "^0.
|
|
64
|
+
"polystore": "^0.26.0"
|
|
69
65
|
},
|
|
70
66
|
"devDependencies": {
|
|
71
67
|
"@types/bun": "^1.3.0",
|
|
72
68
|
"@types/node": "^24.10.0",
|
|
69
|
+
"arktype": "^2.2.3",
|
|
73
70
|
"bun": "^1.3.13",
|
|
74
71
|
"check-dts": "^0.8.2",
|
|
75
72
|
"tsup": "^8.5.1",
|
|
76
|
-
"typescript": "^6.0.2"
|
|
73
|
+
"typescript": "^6.0.2",
|
|
74
|
+
"valibot": "^1.4.2",
|
|
75
|
+
"zod": "^4.4.3"
|
|
77
76
|
}
|
|
78
77
|
}
|
package/readme.md
CHANGED
|
@@ -9,21 +9,22 @@ npm install @server/next
|
|
|
9
9
|
```js
|
|
10
10
|
import server from '@server/next';
|
|
11
11
|
|
|
12
|
-
export default server({
|
|
12
|
+
export default server({ uploads: './uploads' })
|
|
13
13
|
.get('/', () => 'Hello world')
|
|
14
14
|
.get('/users/:id', (ctx) => db.users.find(ctx.url.params.id))
|
|
15
15
|
.post('/avatar', (ctx) => ctx.body.avatar.path);
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
Key-value stores and file storage come included, so `
|
|
18
|
+
Key-value stores and file storage come included, so `sessions` work out of the box and `uploads` takes a folder path. For Redis, S3 and the rest, pass the client straight in:
|
|
19
19
|
|
|
20
20
|
```js
|
|
21
|
-
import server, {
|
|
21
|
+
import server, { bucket } from '@server/next';
|
|
22
|
+
import { createClient } from 'redis';
|
|
22
23
|
|
|
23
|
-
const
|
|
24
|
+
const sessions = createClient({ url });
|
|
24
25
|
const uploads = bucket.S3('my-bucket', { id, key });
|
|
25
26
|
|
|
26
|
-
export default server({
|
|
27
|
+
export default server({ sessions, uploads });
|
|
27
28
|
```
|
|
28
29
|
|
|
29
30
|
See the [full documentation](https://serverjs.io/documentation).
|