記錄用
去除換行
str.replace(/\r\n|\n/g,"");
去除空格
str.replace(/\s+/g, "");
去除換行
str.replace(/\r\n|\n/g,"");
去除空格
str.replace(/\s+/g, "");
struct ngx_http_upstream_srv_conf_s {
ngx_array_t *values;
ngx_array_t *lengths;
ngx_uint_t retries;
in_port_t default_port;
wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | sh
wget -qO- https://toolbelt.heroku.com/install.sh | sh
echo "$ echo 'PATH=\"/usr/local/heroku/bin:\$PATH\"' >> ~/.bashrc"
$ heroku login Enter your Heroku credentials. Email: adam@example.com Password: Could not find an existing public key. Would you like to generate one? [Yn] Generating new SSH public key. Uploading ssh public key /Users/adam/.ssh/id_rsa.pub
$ cd ~/myapp $ heroku create Creating stark-fog-398... done, stack is cedar http://stark-fog-398.herokuapp.com/ | git@heroku.com:stark-fog-398.git Git remote heroku added
$ npm install connect-mongo
mongoStore = require('connect-mongo')(express);
app.configure(function(){
...
app.use(express.session({
secret: "@#$TYHBVGHJIY^TWEYKJHNBGFDWGHJKUYTWE#$%^&*&^%$#",
store: new mongoStore({
host: setting.mongo.host,
port: setting.mongo.port,
db: 'examOnlineSessions',
collection: 'sessions'
})
}));
...
})
With connect:
var connect = require('connect');
var MongoStore = require('connect-mongo')(connect);