@server/next
v0.48.3
Published
A fully-fledged web server with routing, file uploads, sessions, static files, schema validation, websockets, testing, etc.
Readme
Server JS

A modern web server for Bun and Node, with routing, authentication, uploads, WebSockets and testing built in.
npm install @server/nextimport server from '@server/next';
export default server({ uploads: './uploads' })
.get('/', () => 'Hello world')
.get('/users/:id', (ctx) => db.users.find(ctx.url.params.id))
.post('/avatar', (ctx) => ctx.body.avatar.path);Key-value stores and file storage come included, so logins work out of the box and uploads takes a folder path. For Redis, S3 and the rest, pass the client straight in:
import server, { bucket, kv } from '@server/next';
import { createClient } from 'redis';
const redis = kv(createClient({ url }));
const uploads = bucket.S3('my-bucket', { id, key });
export default server({
uploads,
auth: {
strategy: 'cookie',
providers: ['github'],
users: redis.prefix('user:'),
sessions: redis.prefix('session:'),
},
});See the full documentation.
