1.openshift新建应用《Angular Seed with Node.js》
2.npm install request
npm install silly-datetime
3.创建js文件(代码在后面)
4.Bitvise SSH Client 进入sftp上传js文件到目录
5.进入控制台,lsof查看8080端口占用,killall node
6.后台运行 nohup node xxxx.js &
7.访问http://xxx-xxx.rhcloud.com/?rb=true
8.定时重启:https://ifttt.com/my_applets
New applet,点+this,点Date&Time,Ever day at,点+that,搜索web,点Maker Webhooks,填url,get,Content Type选text/plan
js代码:
var http = require(‘http’);
var request = require(‘request’);
var sd = require(‘silly-datetime’);
var appid = ‘xxxxxxxxxxxxxxxxxxxx’;
var token = ‘xxxxxxxxxxxxxxxxxxxxxxx’;
var DEFAULT_PORT = process.env.OPENSHIFT_NODEJS_PORT;
http.createServer(function(req, res){
var time=sd.format(new Date(new Date().getTime() + 43200000), ‘YYYY-MM-DD HH:mm:ss’);
var html = ‘<html>’
+'<head>’
+'<title>DaoCloud Nodejs Reboot</title>’
+'</head>’
+'<body>’
+ time+'<br>’;
var cbool=’Fail’;
try{
var arg = url1.parse(req.url, true).query;
if (arg.rb==’true’)
{
request({
method: ‘POST’,
url:”https://openapi.daocloud.io/v1/apps/”+ appid +”/actions/restart”,
headers: {“Authorization”: token}})
cbool=’Success’;
}
}catch (err){}
html=html+ ‘Reboot DaoCloud ‘+cbool+’ !’
+'</body>’
+'</html>’;
res.writeHead(200,{‘Content-Type’ : ‘text/html’});
res.write(html);
res.end();
}).listen(DEFAULT_PORT,process.env.OPENSHIFT_NODEJS_IP);
tabletter billigt, http://sverige-apotek.life/erytrowet.html , till salu Stockholm.
cialis tГјrkiye fiyatД±
cialis coupon
function of cialis tablets
http://cialisxrm.com/
pharmacy online
canadian pharmacy
pharmacies in canada
order viagra online
prescription drugs canada
metoprolol 100 mg
canadian pharmacy no prescription needed
canadian online pharmacies
highest rated canadian pharmacies
side effects of doxycycline
highest rated canadian pharmacies
clonidine uses
my canadian pharmacy
http://canadianpharmacyrxbsl.com/
prescription price comparison
doxycycline dosage
web medical information
sildenafil 20 mg vs viagra
canadian pharmacies shipping to usa
canadian online pharmacies
pharmacy online
xanax without a doctor’s prescription
best online pharmacy stores
over the counter viagra
northwest pharmacy canada
canadian pharmacies shipping to usa
prescription drugs online without
dangers of stopping metoprolol
discount pharmacy
kamagra kaufen
I have learn a few excellent stuff here. Certainly worth bookmarking for revisiting. I surprise how much attempt you place to create one of these fantastic informative web site.