Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TDDE21 DRIP 2023
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Viktor Norgren
TDDE21 DRIP 2023
Commits
3a14eeb3
Commit
3a14eeb3
authored
1 year ago
by
Martin Larsson
Browse files
Options
Downloads
Patches
Plain Diff
dns functions
parent
26a2926a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
drip-backend-dns/app.py
+31
-0
31 additions, 0 deletions
drip-backend-dns/app.py
drip-backend-dns/run.py
+0
-0
0 additions, 0 deletions
drip-backend-dns/run.py
with
31 additions
and
0 deletions
drip-backend-dns/app.py
0 → 100644
+
31
−
0
View file @
3a14eeb3
from
typing
import
List
,
Dict
,
Tuple
import
flask
import
mysql.connector
import
json
import
uuid
import
bcrypt
import
decimal
"""
Main file that creates the server and all routes as well as the database queries.
Note that the server is using self certified https. This certificate will become invalid sometime in 2022 so worth
checking if issues occur.
"""
# placeholder
app
=
flask
.
Flask
(
__name__
)
config
=
{
'
user
'
:
'
root
'
,
'
password
'
:
'
root
'
,
'
host
'
:
'
db
'
,
'
port
'
:
'
3306
'
,
'
database
'
:
'
drip_drones
'
}
# Example route
@app.route
(
'
/insert/drone
'
,
methods
=
[
'
POST
'
])
def
insert_drone
():
json_req
=
flask
.
request
.
json
insert_drone_to_dns
(
json_req
)
# Respond with a success message or similar.
return
{
"
status
"
:
"
success
"
,
"
message
"
:
"
Drone inserted.
"
},
200
This diff is collapsed.
Click to expand it.
drip-backend-dns/run.py
0 → 100644
+
0
−
0
View file @
3a14eeb3
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment