Removed unneeded files for API version. Cleaned up main.py. Removed unnecessary packages from requirements.txt.
This commit is contained in:
8
main.py
8
main.py
@@ -1,7 +1,6 @@
|
||||
import feedparser as fp
|
||||
from flask import Flask, jsonify
|
||||
from flask_sqlalchemy import SQLAlchemy
|
||||
from urllib.parse import unquote_plus
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
@@ -56,7 +55,6 @@ def updateFeeds(userID):
|
||||
showCheck = []
|
||||
updatedShows = []
|
||||
|
||||
|
||||
# grabs podcast urls from logged in user
|
||||
pc = podcasts.query.filter_by(userID=userID).all()
|
||||
|
||||
@@ -85,7 +83,6 @@ def updateFeeds(userID):
|
||||
return jsonify(newShows=updatedShows)
|
||||
|
||||
|
||||
|
||||
@app.route('/addFeed/<int:userID>/<path:newURL>', methods=['PUT'])
|
||||
def addFeed(userID,newURL):
|
||||
|
||||
@@ -115,6 +112,7 @@ def addFeed(userID,newURL):
|
||||
else:
|
||||
return jsonify(message='Podcast already exists')
|
||||
|
||||
|
||||
@app.route('/listPodcasts/<int:userID>/', methods=['GET'])
|
||||
def listPodcasts(userID):
|
||||
output = []
|
||||
@@ -130,6 +128,7 @@ def listPodcasts(userID):
|
||||
|
||||
return jsonify(shows=output)
|
||||
|
||||
|
||||
@app.route('/register/<string:username>&<string:password>&<string:name>&<string:email>', methods=['POST'])
|
||||
def register(username, password, name, email):
|
||||
# checks to see if the username already exists
|
||||
@@ -143,9 +142,12 @@ def register(username, password, name, email):
|
||||
# if the username doesn't already exist it will be added
|
||||
else:
|
||||
return jsonify(message='Username already exists')
|
||||
|
||||
|
||||
@app.route('/updateStatus/<int:userID>/<int:podcastID>/<int:status>')
|
||||
def updateStatus(userID, podcastID, status):
|
||||
return ''
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run(host='0.0.0.0', debug=True)
|
||||
Reference in New Issue
Block a user