Skip to content
Snippets Groups Projects
Commit 78138a13 authored by abdu's avatar abdu
Browse files

add controller for routing in vue history mode, update Dockerfile

parent a487e61b
No related branches found
No related tags found
No related merge requests found
# need node/npm to run "npm run build" for our vue frontend # need node/npm to run "npm run build" for our vue frontend
FROM node:20-alpine as build-frontend FROM node:20-alpine AS build-frontend
# working directory for our frontend # working directory for our frontend
WORKDIR /app WORKDIR /app
...@@ -22,7 +22,7 @@ FROM eclipse-temurin:17-jre-alpine as build-backend ...@@ -22,7 +22,7 @@ FROM eclipse-temurin:17-jre-alpine as build-backend
WORKDIR /app WORKDIR /app
# copying frontend to static folder so spring can serve it # copying frontend to static folder so spring can serve it
COPY --from build-frontend /app/dist /app/src/main/resources/static COPY --from=build-frontend /app/dist /app/src/main/resources/static
# copying backend to root folder in container # copying backend to root folder in container
COPY . . COPY . .
......
package com.cloudcomputing.todo.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class FallbackController {
@RequestMapping(value = "/**/{path:[^\\.]*}")
public String redirect(){
return "forward:/index.html";
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment