Skip to content

jaguar-examples/static_file

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Example showing how to serve static files with Jaguar

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published