nodejs
1 人追踪
5 篇文章
Phanix

用 node.js 的 forever 執行其他非 node.js 程式

某種程度上可以當作土炮 service 用 有時候因為一些限制,沒辦法把程式註冊成 service 來用,但又要程式可以持續執行,就可以利用 node.js 的 forever 套件來幫忙。forever start -a -l /path/to/myscript_foreve...

Phanix

Node.js 計算目錄內檔案數量

可以用 fs 或者 shelljs 來做,各有千秋 //using fs fs = require('fs'); console.log((fs.readdirSync('../json/')).length); //using shelljs shell = req...

Phanix

nginx configuration for upload file size and nodejs proxy

紀錄一下… Upload file size configuration $ more /etc/nginx/nginx.conf # skip... http { # skip... sendfile on; send_timeout 300s; ...

Phanix

npm配合gitlab-runner避免分支設定不同步

gitlab CI/CD script(.gitlab-ci.yml)理想上要一個版本應付所有分支,且npm install/build的專案建立的資料夾(dist, node_modules)不該被放到repositoy中,但通常又希望拿build好的專案結果直接部屬在正式環境,可以透過下面這些方式來完成。

Phanix

跨網域的cookie與資料安全 / Cross domain cookie and data security

在過去美好(?)的年代,cookie的使用限制較少,但隨著網路安全、更嚴謹的CORS,乃至於個人隱私保護,cookie逐漸單純以追蹤瀏覽器行為的工具,而寬鬆的cookie 存取設定也漸漸變成不受到建議的使用方式。使用 php 的 setcookie() 與 header() 來設...

没有更多