-
Notifications
You must be signed in to change notification settings - Fork 35
Hotreload
Hot reload enables quick debugging, experimentation and bug fixing by restarting the application whenever a change is detected in one of the source files. Use jaguar_hotreload
package to add hot reload feature to your server application.
main() async {
final reloader = HotReloader(debounceInterval: const Duration(seconds: 10));
reloader.addPath('.');
await reloader.go();
final server = Jaguar();
server.get('/hello', (Context ctx) => 'Hello world!');
await server.serve();
}
jaguar_hotreload
uses hot reload feature provided by VM services of Dart SDK.
To run your application with VM service enabled use --observe
command line flag.
dart --observe bin/server.dart
This will start VM services on port 8181. 8181 is the VM service port HotReloader
will listen to by default.
Custom VM service port can be configured using vmServiceUrl
parameter to HotReload
constructor. An application can be configured to serve VM service on a custom port using --enable-vm-service
command line argument:
dart --enable-vm-service:64159 bin/server.dart
If you are using an IDE (like IntelliJ) to execute your application note down what port your IDE start VM service on and the HotReload
instance accordingly.
Basics
- Route handler
- Path matching
- Path parameters
- Query parameters
- Serving static files
- Cookies
- Controller
- Parameter binding
- Hot reload
Serialization
Forms
Sessions
Authentication
- Basic authentication
- Form authentication
- JSON authentication
- Authorization
- OAuth
- MongoDb
- PostgreSQL
- MySQL
- Establish connection
- ORM
- Server sent events (SSE)
- Websockets
- systemd
- Docker
- AppEngine