Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Salamander - API
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Herman Andersen Dyrkorn
Salamander - API
Commits
88f7e32e
Commit
88f7e32e
authored
Jun 11, 2021
by
Herman Andersen Dyrkorn
Browse files
Options
Downloads
Patches
Plain Diff
comment init.py file
parent
0c7eb4f4
Branches
Branches containing commit
No related tags found
1 merge request
!51
Resolve "cleanup and documentation"
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
api/__init__.py
+3
-2
3 additions, 2 deletions
api/__init__.py
with
3 additions
and
2 deletions
api/__init__.py
+
3
−
2
View file @
88f7e32e
...
...
@@ -6,7 +6,7 @@ from flask_sqlalchemy import SQLAlchemy
from
flask_limiter
import
Limiter
from
flask_limiter.util
import
get_remote_address
# flask application setup, with database, JWT, bcrypt and limiter
app
=
Flask
(
__name__
)
app
.
config
[
'
SECRET_KEY
'
]
=
'
randomchangethisshit
'
app
.
config
[
'
SQLALCHEMY_DATABASE_URI
'
]
=
'
sqlite:///database/database.db
'
...
...
@@ -18,7 +18,7 @@ bcrypt = Bcrypt(app)
limiter
=
Limiter
(
app
,
key_func
=
get_remote_address
)
api
=
Api
(
app
)
# import all classes that is used to create endpoints
from
api.endpoints.login
import
Login
from
api.endpoints.user
import
UserEndpoint
from
api.endpoints.location
import
LocationEndpoint
...
...
@@ -32,6 +32,7 @@ from api.endpoints.salamanders import SalamandersEndpoint
from
api.endpoints.findsalamanderinfo
import
FindSalamanderInfo
# add the imported classes to a route
api
.
add_resource
(
Login
,
"
/login
"
)
api
.
add_resource
(
UserEndpoint
,
"
/user
"
)
api
.
add_resource
(
LocationEndpoint
,
"
/location
"
)
...
...
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