GithubHelp home page GithubHelp logo

python_chat's Introduction

chat application python

*Build docker locally docker build -t local/python -f ./Dockerfile .

to run: docker run -it -p 8080:8080 local/python:latest

if you want to map a folder to the docker run: docker run -it -v /Users/behalfusers/PycharmProjects/reporting-appengine/app/shared_resource:/opt/behalf/cto/reporting/data/ -p 8080:8080 local/python:latest

to connect docker exec -it [container] bash

  • Installation pip install virtualenv virtualenv -p python3 env

Before running or deploying this application, install the dependencies using pip: pip install -t lib -r requirements.txt

  • Deploy gcloud app deploy

  • Running the application (need to be in app folder) python main.py

by gunicorn: cd app gunicorn --access-logfile - -b :8080 wsgi

to test:

curl "http://127.0.0.1:8080/keep-alive"

pip basic commands: pip list --outdated

virtualenv wrapper

workon

CURL examples: send message curl -H "Content-Type:application/raw" -X POST "http://127.0.0.1:8080/chat" -d 'hello world'

get message return messages should be in the format json: {"messages": "hello world3", "id": "1"}

curl -H "Content-Type:application/raw" -X GET "http://127.0.0.1:8080/chat/1" curl -H "Content-Type:application/raw" -X DELETE "http://127.0.0.1:8080/chat/12"

application should have class MessageApp to manage internally all messages with ids

The following endpoints should be supported:

  • POST /chat/send (will return id of message)
  • GET /chat/<message_id>/peek (will return json of message)
  • GET /chat/<message_id>/pop (will return json of message)

you should have tests for MessageApp and for flask endpoints

python_chat's People

Contributors

chaimt avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.