Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
easybistro-api-docker
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Sasit Wiratjinda
easybistro-api-docker
Commits
af84c3e3
Commit
af84c3e3
authored
Nov 24, 2022
by
Ai-Sasit
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
a2c37a6f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
3 deletions
+4
-3
main.py
main.py
+2
-2
core.py
server/core.py
+1
-0
database.py
server/service/database.py
+1
-1
No files found.
main.py
View file @
af84c3e3
import
uvicorn
import
uvicorn
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
uvicorn
.
run
(
"server.core:app"
,
host
=
"0.0.0.0"
,
port
=
5000
,
reload
=
True
,
ssl_keyfile
=
"./key.pem"
,
ssl_certfile
=
"./cert.pem"
)
uvicorn
.
run
(
"server.core:app"
,
host
=
"0.0.0.0"
,
port
=
8000
,
reload
=
True
)
\ No newline at end of file
\ No newline at end of file
server/core.py
View file @
af84c3e3
...
@@ -12,6 +12,7 @@ app = FastAPI(docs_url="/api/docs", openapi_url="/api", title="Database REST API
...
@@ -12,6 +12,7 @@ app = FastAPI(docs_url="/api/docs", openapi_url="/api", title="Database REST API
origins
=
[
origins
=
[
"http://localhost:8080"
,
"http://localhost:8080"
,
"http://localhost:8100"
,
"https://easybistro-office.web.app"
,
"https://easybistro-office.web.app"
,
"https://easybistro-owner-manager.web.app"
,
"https://easybistro-owner-manager.web.app"
,
]
]
...
...
server/service/database.py
View file @
af84c3e3
import
pymongo
import
pymongo
def
get_connection
(
collection
:
str
):
def
get_connection
(
collection
:
str
):
# client = pymongo.MongoClient("mongodb://easybistro:xejP3257@13.212.117.20:27017/Easybistro?authSource=admin&retryWrites=true&w=majority")
client
=
pymongo
.
MongoClient
(
'mongodb://easybistro:xejP3257@easybistro-database/Easybistro?authSource=admin&retryWrites=true&w=majority'
)
client
=
pymongo
.
MongoClient
(
'mongodb://easybistro:xejP3257@easybistro-database/Easybistro?authSource=admin&retryWrites=true&w=majority'
)
return
client
[
'easybistro'
][
collection
]
return
client
[
'easybistro'
][
collection
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment