-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
changed directory structure and creating default backend for webapp w…
…ith an html template
- Loading branch information
Showing
21 changed files
with
117 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.env | ||
pycache | ||
venv | ||
mongo-data |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
.env | ||
.gitignore | ||
Jenkinsfile | ||
*.md | ||
*.md | ||
mongo-data |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
version: "3.8" | ||
|
||
services: | ||
webapp: | ||
build: | ||
context: "." | ||
dockerfile: Dockerfile | ||
container_name: webapp | ||
restart: always | ||
env_file: .env | ||
networks: | ||
- webapp | ||
ports: | ||
- 5000:5000 | ||
|
||
mongodb: | ||
image: mongo:6.0.13-jammy | ||
container_name: mongodb | ||
restart: always | ||
environment: | ||
- MONGO_INITDB_ROOT_USERNAME=admin | ||
- MONGO_INITDB_ROOT_PASSWORD=admin | ||
networks: | ||
- webapp | ||
ports: | ||
- 27017:27017 | ||
volumes: | ||
- ./mongo-data:/data/db | ||
|
||
|
||
networks: | ||
webapp: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from pymongo import MongoClient | ||
from flask import Flask | ||
|
||
app = Flask(__name__) | ||
|
||
client = MongoClient("mongodb://admin:admin@localhost","27017") | ||
|
||
db = client["yuval"] | ||
|
||
|
||
if "githubRepos" not in db.list_collection_names(): | ||
db.create_collection("githubRepos") | ||
|
||
collection = db.get_collection("githubRepos") | ||
|
||
collection.insert_one() |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Error</title> | ||
<style> | ||
body { | ||
font-family: 'Arial', sans-serif; | ||
background-color: #f2f2f2; | ||
text-align: center; | ||
padding: 50px; | ||
} | ||
.error-container { | ||
background-color: #fff; | ||
border-radius: 8px; | ||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); | ||
padding: 20px; | ||
display: inline-block; | ||
} | ||
.error-container h1 { | ||
color: #333; | ||
font-size: 24px; | ||
} | ||
.error-container p { | ||
color: #666; | ||
} | ||
.error-container a { | ||
display: inline-block; | ||
padding: 10px 15px; | ||
background-color: #007bff; | ||
color: #fff; | ||
border-radius: 5px; | ||
text-decoration: none; | ||
margin-top: 20px; | ||
} | ||
.error-container a:hover { | ||
background-color: #0056b3; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div class="error-container"> | ||
<h1>Oops! Something went wrong.</h1> | ||
<p>We're sorry, but something went wrong. Please try again later.</p> | ||
<a href="/">Go Back Home</a> | ||
<h3>Available Routes:</h3> | ||
<ul> | ||
{% for route in available_routes %} | ||
<li><a href="{{ route }}">{{ route }}</a></li> | ||
{% endfor %} | ||
</ul> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters