https://github.com/twilkinson3421/neuf
A minimal SSR "framework" for building web applications using Deno. Uses JSX for defining pages, layouts, and components. Includes a file-based router similar to Next.js.
https://github.com/twilkinson3421/neuf
framework full-stack javascript server ssr typescript
Last synced: 10 months ago
JSON representation
A minimal SSR "framework" for building web applications using Deno. Uses JSX for defining pages, layouts, and components. Includes a file-based router similar to Next.js.
- Host: GitHub
- URL: https://github.com/twilkinson3421/neuf
- Owner: twilkinson3421
- License: mit
- Created: 2024-11-18T16:47:31.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-12-03T16:07:35.000Z (over 1 year ago)
- Last Synced: 2025-06-03T20:15:45.768Z (10 months ago)
- Topics: framework, full-stack, javascript, server, ssr, typescript
- Language: TypeScript
- Homepage: https://jsr.io/@neuf/neuf
- Size: 29.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @neuf/neuf
A simple barebones SSR web framework for Deno. Uses preact JSX for templating. Support for file-based routing, dynamic routes, catch-all routes, and route-groups. Build pages using JSX components, pages, layouts, 'documents', and 'route-handlers'.
## Basic Usage
```ts
import { listen, serve, router, type ServeOptions } from "@neuf/neuf";
import { relative, join } from "@std/join";
import { render } from "preact-render-to-string";
const importFn: ServeOptions["importFn"] = async path => {
const thisModuleDir = import.meta.dirname!;
const toCwd = relative(thisModuleDir, Deno.cwd());
const fullPath = join(toCwd, path);
return await import(fullPath);
};
listen({
hostname: "0.0.0.0",
port: 8080,
handler: (req, res, isError) => {
return serve(req, res, {
isError,
isNotFound: false,
staticOptions: { fsRoot: "src/public", quiet: true },
importFn,
router,
renderJSX: render,
});
},
});
```
## Planned Features
- First-party i18n solution
- Middleware support
- More informative logging
## License
[MIT](LICENSE)