1 Star 0 Fork 0

开发者/SmartMirror

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
server.js 650 Bytes
一键复制 编辑 原始数据 按行查看 历史
Shinao 提交于 2016-06-27 11:22 . Separate motion logic from server
var express = require('express');
var config = require('./config');
var app = express();
var http = require('http').Server(app);
app.use(express.static('./public'));
app.get('/', function (req, res) {
res.sendFile(__dirname + '/public/home.html');
});
// Widgets needing infos from server (scraping infos mostly)
var widgets = require('./widgets');
app.get('/weather', widgets.weather);
app.get('/news', widgets.news);
app.get('/cinema', widgets.cinema);
// Forwarding between motion server and client
require('./motion')(app, http);
http.listen(config.web.port, function () {
console.log('Server listening on port %d', config.web.port);
});
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/qiqidie/SmartMirror.git
git@gitee.com:qiqidie/SmartMirror.git
qiqidie
SmartMirror
SmartMirror
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385