Skip to content

Commit

Permalink
Get web_package properly using runfiles API
Browse files Browse the repository at this point in the history
  • Loading branch information
wwwillchen committed Nov 13, 2023
1 parent a5ad1c9 commit 14633da
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions optic/server/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,6 @@ py_binary(
],
deps = [
":server",
"@rules_python//python/runfiles",
],
)
6 changes: 4 additions & 2 deletions optic/server/prod_server.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
from flask import send_from_directory
from .server import app
from rules_python.python.runfiles import runfiles

import os

def get_path():
return os.path.join(os.getcwd(), "web/src/app/web_package")
r = runfiles.Create()
return r.Rlocation("optic/web/src/app/web_package")


@app.route("/")
def serve_root():
Expand Down

0 comments on commit 14633da

Please sign in to comment.