DEV Community

Discussion on: Python to React

 
jkhaui profile image
Jordy Lee

Oh and btw, you can delete all the Spacy code in handler.py and also delete the directory en_core_web_sm-2.1.0. That's just for demo purposes.

Put your Python script in handler.py. This is the code that will let your script be accessed as an API:

    response = {
        'statusCode': 200,
        'headers': {
            'Content-Type': 'application/json',
            'Access-Control-Allow-Origin': '*',
        },
        'body': json.dumps(entities)
    }

    return response
Thread Thread
 
smammar profile image
SMAmmar

sure Jordan, First I will also look into the alternatives. But I highly appreciate the help you provided :).Wish you good luck in your future endeavors.

Thread Thread
 
jkhaui profile image
Jordy Lee

No problem :) Thank you, and best of luck with your app too.