If you want to customize JavaScript with kintone
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!
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
$ 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, 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 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 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.
--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