@Override
protected void initialize(TodoServiceConfiguration configuration,
Environment environment) throws Exception {
final DatabaseFactory factory = new DatabaseFactory(environment);
Database database = factory.build(configuration.getDatabase(), "todo");
final TodoDao dao = database.onDemand(TodoDao.class);
dao.createTableIfNotExists();
environment.addResource(new TodoResource(dao));