mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-11-08 03:23:00 +00:00
29 lines
564 B
JavaScript
29 lines
564 B
JavaScript
/*\
|
|
title: $:/core/modules/server/routes/delete-tiddler.js
|
|
type: application/javascript
|
|
module-type: serverroute
|
|
|
|
DELETE /recipes/default/tiddlers/:title
|
|
|
|
\*/
|
|
(function() {
|
|
|
|
/*jslint node: true, browser: true */
|
|
/*global $tw: false */
|
|
"use strict";
|
|
|
|
exports.method = "DELETE";
|
|
|
|
exports.path = /^\/bags\/default\/tiddlers\/(.+)$/;
|
|
|
|
exports.handler = function(request,response,state) {
|
|
var title = decodeURIComponent(state.params[0]);
|
|
state.wiki.deleteTiddler(title);
|
|
response.writeHead(204, "OK", {
|
|
"Content-Type": "text/plain"
|
|
});
|
|
response.end();
|
|
};
|
|
|
|
}());
|