Newer
Older
weather-servlet / src / main / scala / bootstrap / liftweb / Boot.scala
package bootstrap.liftweb

import net.liftweb.util._
import net.liftweb.http._
import net.liftweb.sitemap._
import net.liftweb.sitemap.Loc._
import Helpers._

import uk.org.floop.msc.wview.DataCollector
import uk.org.floop.msc.rest.{Graph, Dump}
 
/**
  * A class that's instantiated early and run.  It allows the application
  * to modify lift's environment
  */
class Boot {
  def boot {
    // where to search snippet
    LiftRules.addToPackages("uk.org.floop.msc")     

    LiftRules.statelessDispatchTable.prepend {
      case Req("graph" :: args, _, _) =>
        () => Graph(args)
      case Req("dump":: args, _, _) =>
        () => Dump(args)
    }
    DataCollector.start()
  }
  
}