This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
// Firstly, please don't use this in production. | |
// Use nginx forwarding/upstream instead | |
// Nginx is way more secure and battle-tested | |
// ################ | |
// ### Method 1 ### | |
// ################ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# http://forums.powervps.com/showthread.php?t=1313 | |
# f = background | |
ssh -Ngf -L 12345:127.0.0.1:3306 [email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
// Modules | |
var request = require('request'); | |
var nock = require('nock'); | |
// API You want to use/mock/test | |
var api_url = 'http://api.example.com'; | |
// You can put this into a separate .json file and just require() it |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# First, run your node script with nohup | |
# (keep the "&" at the end, it puts the process in teh background) | |
nohup node server/index.js --port 8443 & | |
# Now we capture the process ID so we know what to kill later | |
export SERVER_PID=$!; | |
echo $SERVER_PID; | |
# Sleep 5 Seconds to allow the server script time to startup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This Gist will help you configure SSL on a pure Node.js server | |
(without a server like Apache/nginx, but you should probably use it in production!) |
NewerOlder