Skip to content

Commit

Permalink
front and backend servers one call
Browse files Browse the repository at this point in the history
  • Loading branch information
Russ Garner committed Jun 28, 2022
1 parent e70a524 commit b292c12
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 9 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,9 @@ npm install
<br/>

## Step 7) Run it!
I didn't link them up into a single command, so you might need to open two shells
It's linked up into a single command, this starts the front and backend servers:
```
python main.py
cd frontend
npm start
```

Now you should be redirected to https://embed.demo.com:3000 where you should see an embeded dashboard
Expand Down
1 change: 0 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"private": true,
"dependencies": {
"@looker/embed-sdk": "^1.6.1",
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^13.3.0",
"@testing-library/user-event": "^13.5.0",
"react": "^18.2.0",
Expand Down
5 changes: 0 additions & 5 deletions frontend/src/setupTests.js

This file was deleted.

3 changes: 3 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from fastapi import FastAPI, Request
import uvicorn
from fastapi.middleware.cors import CORSMiddleware
import subprocess
app = FastAPI()
from auth import generateUrlLocally, urlFromLookerAPI

Expand Down Expand Up @@ -29,7 +30,9 @@ def auth_from_api(request: Request,src:str=""):
userToken = request.headers.get('usertoken')
return urlFromLookerAPI(src, userToken)


if __name__ == '__main__':
subprocess.Popen("cd frontend; npm start", shell=True)
uvicorn.run(
'main:app', port=8000, host='0.0.0.0',
reload=True,
Expand Down

0 comments on commit b292c12

Please sign in to comment.