Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
U
url_shorter_docker
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Jonas Leder
url_shorter_docker
Commits
f087a031
Verified
Commit
f087a031
authored
Feb 28, 2022
by
Jonas Leder
Browse files
Options
Downloads
Patches
Plain Diff
don't return qr image
parent
c403602e
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/api.py
+4
-15
4 additions, 15 deletions
app/api.py
app/templates/apiDocs.html
+0
-8
0 additions, 8 deletions
app/templates/apiDocs.html
with
4 additions
and
23 deletions
app/api.py
+
4
−
15
View file @
f087a031
from
flask
import
jsonify
,
render_template
from
sqlite3
import
connect
from
makeqr
import
makeQR
def
apiGet
(
request
,
url_scheme
,
s
,
sAPI
,
passwordProtected
):
try
:
...
...
@@ -72,16 +71,6 @@ def apiPost(request, url_scheme, domain, sAPI, passwordProtected, password):
'
INSERT INTO WEB_URL (LONG_URL, SHORT_URL, USERNAME) VALUES (?, ?, ?)
'
,
[
longURL
,
short
,
username
]
)
try
:
request
.
form
[
'
qr
'
]
qr64
=
"
data:image/jpeg;base64,
"
+
makeQR
(
url_scheme
+
"
://
"
+
short
)
return
jsonify
(
status
=
"
0
"
,
message
=
"
ok
"
,
qr
=
qr64
)
except
:
return
jsonify
(
status
=
"
0
"
,
message
=
"
ok
"
...
...
This diff is collapsed.
Click to expand it.
app/templates/apiDocs.html
+
0
−
8
View file @
f087a031
...
...
@@ -56,7 +56,6 @@
<ul>
<li>
short: the short URL you want to get. example: {{domain}}/example
</li>
<li>
long: the long URL you want to short
</li>
<li>
qr: if you add this parameter you will get an base64 encoded QR code image
</li>
<li>
apikey: you can add this argument, if you want to assign this link to your account.
</li>
{% if passwordProtected %}
<li>
password: this value contains the password, that is needed to short a link.
</li>
...
...
@@ -69,7 +68,6 @@
<ul>
<li>
status: The status code of the reponse. Down there is a table with the posible response codes
</li>
<li>
message: This argument will do the same like the status code, but it is written out, for reading by human.
</li>
<li>
qr: If you enabled this argument, the response will include a QR code of the shorten link as base64 coded jpeg image
</li>
</ul>
<br>
...
...
@@ -107,10 +105,4 @@
{% endif %}
</table>
<br>
<h2>
Preview image
</h2>
<p>
Please paste your base64 image here:
<input
type=
"text"
id=
"base64Input"
>
<button
onclick=
'document.getElementById("base64Image").src = document.getElementById("base64Input").value;'
>
show
</button><br>
<smaller>
(this will not work very well in google Chrome)
</smaller></p>
<img
id=
"base64Image"
>
</body>
\ No newline at end of file
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