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
a69426dc
Commit
a69426dc
authored
Nov 23, 2022
by
Ai-Sasit
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update mongodb
parent
cc9195c2
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
2 deletions
+36
-2
docker-compose.yml
docker-compose.yml
+32
-0
core.py
server/core.py
+3
-1
database.py
server/service/database.py
+1
-1
No files found.
docker-compose.yml
0 → 100644
View file @
a69426dc
version
:
'
3'
services
:
web
:
container_name
:
easybistro-api
build
:
.
ports
:
-
"
80:80"
depends_on
:
-
mongodb
mongodb
:
image
:
mongo:latest
container_name
:
database
ports
:
-
27017:27017
environment
:
MONGO_INITDB_ROOT_USERNAME
:
easybistro
MONGO_INITDB_ROOT_PASSWORD
:
xejP3257
mongo-express
:
image
:
mongo-express:latest
container_name
:
mongo-monitor
ports
:
-
8081:8081
environment
:
ME_CONFIG_MONGODB_ADMINUSERNAME
:
easybistro
ME_CONFIG_MONGODB_ADMINPASSWORD
:
xejP3257
ME_CONFIG_MONGODB_SERVER
:
database
depends_on
:
-
mongodb
server/core.py
View file @
a69426dc
import
re
from
fastapi
import
FastAPI
from
fastapi.middleware.cors
import
CORSMiddleware
from
fastapi.middleware.httpsredirect
import
HTTPSRedirectMiddleware
from
server.routes.scb_service
import
scb
from
server.routes.user
import
user
...
...
@@ -17,7 +19,7 @@ origins = [
"https://easybistro-office.web.app"
,
"https://easybistro-owner-manager.web.app"
,
]
app
.
add_middleware
(
HTTPSRedirectMiddleware
)
app
.
add_middleware
(
CORSMiddleware
,
allow_origins
=
origins
,
...
...
server/service/database.py
View file @
a69426dc
...
...
@@ -2,7 +2,7 @@ import pymongo
def
get_connection
(
collection
:
str
):
client
=
pymongo
.
MongoClient
(
'mongodb
+srv://SasitAi:Tackle123@easybistro.7qdtgg2.mongodb.net
/Easybistro'
)
client
=
pymongo
.
MongoClient
(
'mongodb
://easybistro:xejP3257@localhost:27017
/Easybistro'
)
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