main.swift 698 B

12345678910111213141516171819202122232425
  1. /// We have isolated all of our App's logic into
  2. /// the App module because it makes our app
  3. /// more testable.
  4. ///
  5. /// In general, the executable portion of our App
  6. /// shouldn't include much more code than is presented
  7. /// here.
  8. ///
  9. /// We simply initialize our Droplet, optionally
  10. /// passing in values if necessary
  11. /// Then, we pass it to our App's setup function
  12. /// this should setup all the routes and special
  13. /// features of our app
  14. ///
  15. /// .run() runs the Droplet's commands,
  16. /// if no command is given, it will default to "serve"
  17. var config = try Config()
  18. try config.set("fluent.driver", "postgresql")
  19. try config.setup()
  20. let drop = try Droplet(config)
  21. try drop.setup()
  22. try drop.run()