Commit 4760847c authored by Pamal-Ranasinghe's avatar Pamal-Ranasinghe

REST API configured

parent 99e14736
#import flask module #import flask module
from flask import Flask from flask import Flask
from flask_restful import Api
from flask import Flask
from resources.routes import initialize_routes
app = Flask(__name__) app = Flask(__name__)
api = Api(app)
#Test route #Test route
@app.route('/') @app.route('/')
def hello_world(): def hello_world():
return 'Hello World' return 'Hello World'
#initialize all the routes
initialize_routes(api)
#Main function #Main function
if __name__ == '__main__': if __name__ == '__main__':
app.run() app.run()
\ No newline at end of file
from .speechExtraction import SpeechExtraction
def initialize_routes(api):
api.add_resource(SpeechExtraction, "/api/extraction")
\ No newline at end of file
from flask_restful import Resource
import speech_recognition as sr
import moviepy.editor as mp
class SpeechExtraction(Resource):
def get(self):
return 'API is working'
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment