Explosive speed! Using Python Simple HTTP Server for kintone development

Troublesome to upload JavaScript

If you want to customize JavaScript with kintone

  1. App settings
  2. JavaScript / CSS customization
  3. Upload and add
  4. App update

It's annoying. It takes about 20 seconds even if you do it fairly quickly.

Another option is to use DropBox, but it's prohibited by the company, and sometimes it's slow to sync from a client PC to DropBox.

I want to make a kintone app at a faster speed!

It is OK if you set up a web server on localhost

As you know, kintone allows you to register JavaScript with a URL, so the strategy is to create that URL locally.

I felt that it was exaggerated to start a VM with vagrant etc., so I decided to use python as the title suggests.

The main procedure is the following 4 points if you do not care about the details.

--Terminal preparation (use cygwin etc. for Windows) --python installation --Certificate creation --Run Python on https://gist.github.com/dergachev/7028596

Working in the terminal

$ wget https://gist.github.com/dergachev/7028596/raw/abb8bd2b53501ff7125b93e8d975e77ffd756bf1/simple-https-server.py
$ ls
./  ../  css/  js/  simple-https-server.py
$ openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes

$ ls
./  ../  css/  js/  server.pem  simple-https-server.py
$ python simple-https-server.py

You will be asked various things such as the name of the country for setting the certificate, but for the time being it is troublesome, so press Enter repeatedly.

If you access https: // localhost: 4443 / after the above work, directory.jpg It's like, the place where I ran python earlier is the DocumentRoot as it is. (Convenient) When you access https: // localhost: 4443 / js / script.js directory.jpg Local js can be accessed from the browser ...

However, if you look closely, https is shaded in red and it is a certificate error lol But for the time being, it's OK because the contents have been removed. .. !!

I'm sorry, I didn't have time to look it up. For the time being, you can use it even if you register with kintone!

So if you fix the above source mistake locally and reload the browser directory.jpg The changes will be reflected. With this, kintone development and debugging are also explosive.

I took the trouble to capture it, but the point is that if you register this URL in "Register by specifying the URL" in the application settings, the editing of the file at hand will be reflected quickly on the local simple https server, so DropBox I think that the update of the URL file registered in the kintone app will be much faster than that.

Notes

--Let's make it inaccessible from the outside ――It is only used for "development" and "debugging". The kintone app can only load JavaScript on your PC. (JS doesn't work on other people's PCs at all) --I'm not very familiar with the server side, so please forgive me for certificate errors. We will update as soon as we know the solution.

Recommended Posts

Explosive speed! Using Python Simple HTTP Server for kintone development
Simple HTTP Server for python
Python development environment for macOS using venv 2016
Explosive speed with Python (Bottle)! Web API development
Directory structure for test-driven development using pytest in python
A simple Python HTTP server that supports Range Requests
HTTP server and HTTP client using Socket (+ web browser) --Python3
Build a web API server at explosive speed using hug
How to specify a public directory Python simple HTTP server
# 1 [python3] Simple calculation using variables
Easy HTTP server with Python
[For organizing] Python development environment
Build a local development environment for Lambda + Python using Serverless Framework
Write an HTTP / 2 server in Python
Python development environment options for May 2020
[TouchDesigner] Tips for for statements using python
Emacs settings for Python development environment
[Python] Reasons for overriding using super ()
[Python] Multiplication table using for statement
Create a Python development environment locally at the fastest speed (for beginners)
Build a lightweight server in Python and listen for Scratch 2 HTTP extensions
Notes for using OpenCV on Windows10 Python 3.8.3.
A simple HTTP client implemented in Python
[50 counts] Key transmission using Python for Windows
[python, multiprocessing] Behavior for exceptions when using multiprocessing
6 Python libraries for faster development and debugging
Tips for using python + caffe with TSUBAME
Notes for using python (pydev) in eclipse
Python development server construction procedure (AWS + Anaconda)
Building a Python development environment for AI development