@@ -64,14 +64,24 @@ func init() {
6464 Handler : serveSearch ,
6565 Description : "Search websocket endpoint" ,
6666 },
67+ // tmp added for backward compatibility
6768 & Endpoint {
6869 Name : "Add" ,
69- Path : "/add" ,
70+ Path : "/api/ add" ,
7071 Method : GET ,
7172 CSRFRequired : true ,
7273 Handler : serveAdd ,
7374 Description : "Add document form" ,
7475 },
76+ & Endpoint {
77+ Name : "Add post" ,
78+ Path : "/api/add" ,
79+ Method : POST ,
80+ CSRFRequired : true ,
81+ Handler : serveAdd ,
82+ Description : "Save added document" ,
83+ },
84+ // alias for /api/add - backward compatibility - use /api/add in the future
7585 & Endpoint {
7686 Name : "Add post" ,
7787 Path : "/add" ,
@@ -82,7 +92,7 @@ func init() {
8292 },
8393 & Endpoint {
8494 Name : "Get document" ,
85- Path : "/document" ,
95+ Path : "/api/ document" ,
8696 Method : GET ,
8797 CSRFRequired : false ,
8898 Handler : serveGet ,
@@ -98,63 +108,63 @@ func init() {
98108 },
99109 & Endpoint {
100110 Name : "Rules" ,
101- Path : "/rules" ,
111+ Path : "/api/ rules" ,
102112 Method : GET ,
103113 CSRFRequired : true ,
104114 Handler : serveRules ,
105115 Description : "Rules page" ,
106116 },
107117 & Endpoint {
108118 Name : "Save rules" ,
109- Path : "/rules" ,
119+ Path : "/api/ rules" ,
110120 Method : POST ,
111121 CSRFRequired : true ,
112122 Handler : serveRules ,
113123 Description : "Save rules" ,
114124 },
115125 & Endpoint {
116126 Name : "History" ,
117- Path : "/history" ,
127+ Path : "/api/ history" ,
118128 Method : GET ,
119129 CSRFRequired : true ,
120130 Handler : serveHistory ,
121131 Description : "History page" ,
122132 },
123133 & Endpoint {
124134 Name : "Add history item" ,
125- Path : "/history" ,
135+ Path : "/api/ history" ,
126136 Method : POST ,
127137 CSRFRequired : true ,
128138 Handler : serveHistory ,
129139 Description : "Add new history item" ,
130140 },
131141 & Endpoint {
132142 Name : "Delete" ,
133- Path : "/delete" ,
143+ Path : "/api/ delete" ,
134144 Method : POST ,
135145 CSRFRequired : true ,
136146 Handler : serveDeleteDocument ,
137147 Description : "Delete document endpoint" ,
138148 },
139149 & Endpoint {
140150 Name : "Delete alias" ,
141- Path : "/delete_alias" ,
151+ Path : "/api/ delete_alias" ,
142152 Method : POST ,
143153 CSRFRequired : true ,
144154 Handler : serveDeleteAlias ,
145155 Description : "Delete alias" ,
146156 },
147157 & Endpoint {
148158 Name : "Add alias" ,
149- Path : "/add_alias" ,
159+ Path : "/api/ add_alias" ,
150160 Method : POST ,
151161 CSRFRequired : true ,
152162 Handler : serveAddAlias ,
153163 Description : "Add alias" ,
154164 },
155165 & Endpoint {
156166 Name : "Readable" ,
157- Path : "/readable" ,
167+ Path : "/api/ readable" ,
158168 Method : GET ,
159169 CSRFRequired : false ,
160170 Handler : serveReadable ,
0 commit comments