mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-08-28 20:12:41 +00:00
![Jeremy Ruston](/assets/img/avatar_default.png)
It is now possible to create and edit tiddlers, using the existing tiddlywebadaptor syncing mechanism. There are a lot of hacks and lumpiness to make things compatible, so I think I will end up with an independent implementation
43 lines
885 B
JavaScript
43 lines
885 B
JavaScript
/*\
|
|
title: $:/plugins/tiddlywiki/multiwikiserver/route-get-status.js
|
|
type: application/javascript
|
|
module-type: route
|
|
|
|
GET /wikis/:recipe_name/status
|
|
|
|
\*/
|
|
(function() {
|
|
|
|
/*jslint node: true, browser: true */
|
|
/*global $tw: false */
|
|
"use strict";
|
|
|
|
exports.method = "GET";
|
|
|
|
exports.path = /^\/wiki\/([^\/]+)\/status$/;
|
|
|
|
exports.handler = function(request,response,state) {
|
|
// Get the recipe name from the parameters
|
|
var recipe_name = $tw.utils.decodeURIComponentSafe(state.params[0]);
|
|
// Compose the response
|
|
var text = JSON.stringify({
|
|
username: "Joe Bloggs",
|
|
anonymous: false,
|
|
read_only: false,
|
|
logout_is_available: false,
|
|
space: {
|
|
recipe: recipe_name
|
|
},
|
|
tiddlywiki_version: $tw.version
|
|
});
|
|
// Send response
|
|
if(text) {
|
|
state.sendResponse(200,{"Content-Type": "application/json"},text,"utf8");
|
|
} else {
|
|
response.writeHead(404);
|
|
response.end();
|
|
}
|
|
};
|
|
|
|
}());
|