mirror of
https://github.com/ollama/ollama.git
synced 2026-03-11 17:34:04 -05:00
fix: allow app to build without UI dist directory
Add a placeholder README.md in app/ui/app/dist so the go:embed directive doesn't fail when the UI hasn't been built. Also improve the error message when index.html is not found to help developers understand they need to run 'npm run build'.
This commit is contained in:
@@ -33,7 +33,10 @@ func (s *Server) appHandler() http.Handler {
|
||||
data, err := fs.ReadFile(fsys, "index.html")
|
||||
if err != nil {
|
||||
if errors.Is(err, fs.ErrNotExist) {
|
||||
http.NotFound(w, r)
|
||||
// Development mode: UI not built
|
||||
w.Header().Set("Content-Type", "text/plain")
|
||||
w.WriteHeader(http.StatusNotFound)
|
||||
w.Write([]byte("UI not built. Run 'npm run build' in app/ui/app directory."))
|
||||
} else {
|
||||
http.Error(w, "Internal Server Error", http.StatusInternalServerError)
|
||||
}
|
||||
|
||||
1
app/ui/app/dist/README.md
vendored
Normal file
1
app/ui/app/dist/README.md
vendored
Normal file
@@ -0,0 +1 @@
|
||||
This directory contains the built React app. Run `npm run build` in the app directory to generate the build.
|
||||
Reference in New Issue
Block a user