mirror of
https://github.com/moparisthebest/kaiwa
synced 2025-01-11 21:58:35 -05:00
Fix generating appcache on server start
This commit is contained in:
parent
cf01bd70a6
commit
51b0f213eb
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "otalk.im",
|
||||
"version": "0.0.7",
|
||||
"version": "0.0.8",
|
||||
"description": "Otalk: WebRTC Enabled XMPP Client, in the Browser",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
20
server.js
20
server.js
@ -49,7 +49,7 @@ if (config.isDev) {
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
clientApp.on('ready', function () {
|
||||
var pkginfo = JSON.parse(fs.readFileSync('./package.json'));
|
||||
|
||||
var manifestTemplate = fs.readFileSync('./clientapp/templates/misc/manifest.cache', 'utf-8');
|
||||
@ -58,20 +58,30 @@ var cacheManifest = manifestTemplate
|
||||
.replace('#{jsFileName}', '/' + clientApp.jsFileName())
|
||||
.replace('#{cssFileName}', '/' + clientApp.cssFileName());
|
||||
|
||||
var webappManifest = fs.readFileSync('./public/x-manifest.webapp');
|
||||
|
||||
app.get('/manifest.cache', function (req, res, next) {
|
||||
res.set('Content-Type', 'text/cache-manifest');
|
||||
res.set('Cache-Control', 'public, max-age=0');
|
||||
res.send(cacheManifest);
|
||||
});
|
||||
});
|
||||
|
||||
var webappManifest = fs.readFileSync('./public/x-manifest.webapp');
|
||||
|
||||
app.set('view engine', 'jade');
|
||||
|
||||
app.get('/login', function (req, res) {
|
||||
res.render('login');
|
||||
});
|
||||
|
||||
app.get('/logout', function (req, res) {
|
||||
res.render('logout');
|
||||
});
|
||||
|
||||
app.get('/oauth/login', function (req, res) {
|
||||
res.redirect('https://apps.andyet.com/oauth/authorize?client_id=' + config.andyetAuth.id + '&response_type=token');
|
||||
});
|
||||
|
||||
app.get('/oauth/callback', function (req, res) {
|
||||
res.render('oauthLogin');
|
||||
});
|
||||
@ -81,12 +91,6 @@ app.get('/manifest.webapp', function (req, res, next) {
|
||||
res.send(webappManifest);
|
||||
});
|
||||
|
||||
app.get('/manifest.cache', function (req, res, next) {
|
||||
res.set('Content-Type', 'text/cache-manifest');
|
||||
res.set('Cache-Control', 'public, max-age=0');
|
||||
res.send(cacheManifest);
|
||||
});
|
||||
|
||||
app.get('/oembed', function (req, res) {
|
||||
var callback = req.query.callback;
|
||||
if (req.query.url) {
|
||||
|
Loading…
Reference in New Issue
Block a user