1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-26 15:23:15 +00:00
TiddlyWiki5/core/modules/server/routes/get-status.js
Arlen22 be026aa308
Revert "Add server sent events (#5279)" (#5880)
This reverts commit 17b4f53ba2 according to Github Desktop.

git checkout that commit
revert commit in GitHub Desktop
git switch -c revert-sse
uncommit in Github Desktop
switch to master, bringing changes
resolve deletions with command line
2021-07-14 17:16:57 +01:00

33 lines
717 B
JavaScript

/*\
title: $:/core/modules/server/routes/get-status.js
type: application/javascript
module-type: route
GET /status
\*/
(function() {
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
exports.method = "GET";
exports.path = /^\/status$/;
exports.handler = function(request,response,state) {
var text = JSON.stringify({
username: state.authenticatedUsername || state.server.get("anon-username") || "",
anonymous: !state.authenticatedUsername,
read_only: !state.server.isAuthorized("writers",state.authenticatedUsername),
space: {
recipe: "default"
},
tiddlywiki_version: $tw.version
});
state.sendResponse(200,{"Content-Type": "application/json"},text,"utf8");
};
}());