mardi 21 avril 2015

Deploy bottle.py web service in Amazon EC2

I have written a very simple web service in python using the bottle web framework. It works perfectly fine locally. Now I want to deploy it on AWS EC2 instance. I googled but could not find a way to deploy the web service. I'm a noobie at web services and deployments, so can someone please tell me the configurations of deployment.

Following is the code I wrote for my web service:

import bottle # Web server
from bottle import run, route, request, get, post

@route('/')
def index():
    """ Display welcome & instruction messages """
    return "<p>Welcome to my bottle.py powered server !</p> \
           <p>To call the web service use :\
       http://localhost:8080/login"

@route('/login', method='POST')
def do_login():
    ..
    ..

if __name__ == '__main__':        
    # To run the server, type-in $ python server.py
    bottle.debug(True) # display traceback 
    run(host='localhost', port=8080, reloader=True) 




Aucun commentaire:

Enregistrer un commentaire