jaspr_serverpod 0.3.1+1 jaspr_serverpod: ^0.3.1+1 copied to clipboard
Serverpod integration for jaspr.
🚀 Serverpod integration for Jaspr #
This package provides an integration between Jaspr and Serverpod.
It provides:
JasprRoute
to use in your Serverpod webserver to server-side render Jaspr components.context.session
extension to get theSession
inside a componentsbuild()
method.JasprConnectivityMonitor
for your generated Serverpod client.
Follow the setup below or check out one of our examples:
Setup #
Refer to our official Setup Guide on how to integrate Jaspr with Serverpod.
Running during development #
After you have setup the integration, simply run jaspr serve
in your terminal to start both the Jaspr development server and run Serverpod in debug mode.
This fully replaces the need to run dart bin/main.dart
during development. However on a fresh project or when you update
your models, you might need to run dart bin/main.dart --apply-migrations
from time to time.
Building and deploying #
To build your project, run jaspr build -i bin/main.dart
in your terminal.
If you are using docker to deploy your project, modify the Dockerfile
like this:
FROM dart:3.2.5 AS build
...
+ RUN dart pub global activate jaspr_cli
RUN dart pub get
- RUN dart compile exe bin/main.dart -o bin/main
+ RUN jaspr build -i lib/main.dart -v
...
FROM busybox:1.36.1-glibc
...
COPY --from=build /runtime/ /
- COPY --from=build /app/bin/main /app/bin/main
+ COPY --from=build /app/build/jaspr/app /app/bin/main
COPY --from=build /app/config/ config/
- COPY --from=build /app/web/ web/
+ COPY --from=build /app/build/jaspr/web/ web/
...