1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2026-04-22 23:01:28 +00:00
Files
TiddlyWiki5/core/modules/serverroute/get-status.js
2018-06-21 09:32:15 +01:00

32 lines
573 B
JavaScript

/*\
title: $:/core/modules/serverroute/get-status.js
type: application/javascript
module-type: serverroute
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) {
response.writeHead(200, {"Content-Type": "application/json"});
var text = JSON.stringify({
username: state.server.get("username"),
space: {
recipe: "default"
},
tiddlywiki_version: $tw.version
});
response.end(text,"utf8");
};
}());