package com.emonster.taroaichat.web.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
public class ClientForwardController {

    /**
     * Forwards any requests that don't match a static file or an API endpoint to the
     * frontend's entry point.
     */
    @GetMapping(value = "/{path:[^\\.]*}")
    public String forward() {
        // Forward to the root path so that the SPA can handle the routing.
        return "forward:/";
    }
}
