package com.example.demo.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.example.demo.repo.DBService;

@Controller
public class RootController {
    @Autowired
    private DBService dbService;
    
    @RequestMapping("/")
    public String root() {
        return "index.html";
    }
    
    @RequestMapping("/init")
    public String initDatabase() {
        dbService.initDatabase();
        return "redirect:/";
    }
    

}
