Git Product home page Git Product logo

srental's Introduction

Pre-requirements

Python 3.10 ( if you don't have python 3.10, please download and install from here: https://www.python.org/downloads/release/python-31010/)

  • For Mac, you can use the command below to install python3.10
brew install [email protected]

# link: https://installvirtual.com/how-to-install-python-3-10-on-mac-using-brew/

Follow below steps to verify the restful endpoint

  1. Get the source code of the project
# Option1: Unzip the compressed file
tar -zxf srental-0.0.1.tar.gz

# Option2: Git clone from repo
git clone https://github.com/everydots/srental.git
  1. Go into project and create a virtual environment and activate it by using python 3.10:
cd srental-0.0.1
python -m venv venv
source venv/bin/activate
  1. Run below command to install the project dependencies:
pip install -r requirements.txt
  1. Run below command in your local to start a flask application (in production, can use Gunicorn or Waitress)
    1. By default, this app will listen port 8080. If port already been used, Can add parameter --port 9090 to specify another port
    2. By default, this app using development mode. If you want to change, Can modify FLASK_DEBUG to false in file: .flaskenv
flask run --port 8080 
  1. Run below command to call restful endpoint of /spaceship/optimize after your app run successfully
curl -s -H "Content-Type: application/json" -X POST "http://localhost:8080/spaceship/optimize" -d "[{\"name\": \"Contract1\", \"start\": 0, \"duration\": 5, \"price\": 10},{\"name\": \"Contract2\", \"start\": 3, \"duration\": 7, \"price\": 14},{\"name\": \"Contract3\", \"start\": 5, \"duration\": 9, \"price\": 8},{\"name\": \"Contract4\", \"start\": 5, \"duration\": 9, \"price\": 7}]"

srental's People

Watchers

 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.