WebServer constructor

WebServer({
  1. dynamic host,
  2. dynamic port,
  3. List<QDotRoute>? routes,
  4. List<String> filetypes = const ['css', 'js', 'ico'],
})

Implementation

WebServer({host,port,List<QDotRoute>? routes,List<String> filetypes=const ['css','js','ico']}){
  this.routes[RegExp(r'^$')] = IndexRoute();
  if(host!=null) _host = host;
  if(port!=null) _port=port;
  if(routes!=null){
    for(QDotRoute r in routes){
      this.routes[URIHandler.generateRegex(r.path)] = r;
    }
  }
  this.filetypes = filetypes;
}