Skip to content
This repository has been archived by the owner on Jun 4, 2020. It is now read-only.

Commit

Permalink
Documenting the REST basics
Browse files Browse the repository at this point in the history
  • Loading branch information
santanche authored Mar 18, 2019
1 parent 6fbe2d7 commit 2d7082a
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions basics/rest-server/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Jupyter Kernel Gateway Example

This example uses as server the Jupyter Kernel Gateway: https://test-jupyterkernelgateway.readthedocs.io/en/latest/index.html

## Linux

### Install

Install the Jupyter Kernel Gateway
~~~~
pip3 install jupyter_kernel_gateway
~~~~

### Run

Go to the server directory inside the Git project:
~~~~
cd ~/git/case-notebook/notebook/server
~~~~

To start the server run in the terminal (POST version):
~~~~
~/.local/bin/jupyter kernelgateway --KernelGatewayApp.api='kernel_gateway.notebook_http' --KernelGatewayApp.seed_uri='~/git/case-notebook/basics/rest-server/rest-server-post-convert-angle.ipynb' --KernelGatewayApp.allow_origin='*' --KernelGatewayApp.allow_methods='POST, GET, OPTIONS' --KernelGatewayApp.allow_headers='Content-Type'
~~~~

## Windows
~~~~
jupyter kernelgateway --KernelGatewayApp.api='kernel_gateway.notebook_http' --KernelGatewayApp.seed_uri='/Users/<User>/git/case-notebook/basics/rest-server/rest-server-post-convert-angle.ipynb' --KernelGatewayApp.allow_origin='*' --KernelGatewayApp.allow_methods='POST, GET, OPTIONS' --KernelGatewayApp.allow_headers='Content-Type'
~~~~

* `--KernelGatewayApp.allow_origin='*'` -> accepts all origins (better restrict in the future)
* `--KernelGatewayApp.allow_methods='POST, GET, OPTIONS'` -> accepted types of request
* `--KernelGatewayApp.allow_headers='Content-Type'` -> things that can appear in the header

Details at:

* Jupyter Kernel Gateway configuration: https://test-jupyterkernelgateway.readthedocs.io/en/latest/config-options.html

0 comments on commit 2d7082a

Please sign in to comment.