node.js - Deploy DocPad to Gandi.net Simple Hosting -
i'm trying deploy first docpad website gandi.net hosting provider, service : https://www.gandi.net/hebergement/simple?language=nodejs&grid=a
my code here : https://github.com/nylnook/nylnook-website
it's running fine locally on computer.
technically seem 'vhost', , i'm supposed write "server.js" file deploy docpad in production gandi server, after used :
git push gandi master
('gandi' being git remote repo @ server)
, used custom command (xxx instead of login) :
ssh xxxxx@git.xxx.gpaas.net 'deploy default.git'
they have guide node.js instance : http://wiki.gandi.net/en/simple/instance/nodejs?s[]=node , guide git usage on servers : http://wiki.gandi.net/en/simple/git
that suggest use code : https://github.com/visionmedia/express/blob/master/examples/vhost/index.js
but newbie node.js, learning docpad, can't figure how !
last link, docpad guide deployment followed far : http://docpad.org/docs/deploy
thanks !
edit : lead maybe :http://docpad.org/docs/api#using-with-express
answering myself documentation : need modify 3 files
in server.js (thanks plflannery : https://github.com/bevry/docpad/issues/819) :
var spawn = require('child_process').spawn var args = ['server']; spawn('node_modules/.bin/docpad', args, {stdio:'inherit'}).on('close', function(err) { if (err) console.log("docpad failed"); else console.log("docpad running"); });
in docpad.coffee, put :
port: 8080
in docpadconfig fonction, change default port (9778) 8080, required gandi, explanations here : https://github.com/bobobo1618/docpad-docum...
and in package.json put
"main": "server.js"
instead of
"main": "node_modules/docpad/bin/docpad-server"
so launch docpad , install dependencies when deployment via git.
example of working code : https://github.com/nylnook/nylnook-website
good luck in projects !
Comments
Post a Comment