jaguar_examples_static_file 2.2.0 jaguar_examples_static_file: ^2.2.0 copied to clipboard
Example showcasing how to serve static files using Jaguar
static_file #
Example to demonstrate serving static files using Jaguar. Uses staticFiles
method on Jaguar
object.
import 'package:jaguar/jaguar.dart';
import 'package:path/path.dart' as p;
main(List<String> arguments) async {
final server = new Jaguar(port: 10001);
// Serve with prefix stripped. Similar to 'alias' in Nginx.
server.staticFiles('/static/*', 'static');
await server.serve();
}
Instructions #
Instructions can be found at: Serving static files