[MAJOR][FIRSTCOMMIT] Added basic routes, controllers, repos to kanban service (no postgres yet)
This commit is contained in:
27
lib/public/scripts/http.js
Normal file
27
lib/public/scripts/http.js
Normal file
@@ -0,0 +1,27 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var Http = (() => {
|
||||
// Setup request for json
|
||||
var getOptions = (verb, data) => {
|
||||
var options = {
|
||||
dataType: 'json',
|
||||
method: verb,
|
||||
headers: {
|
||||
'Accept': 'application/json',
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
};
|
||||
if (data) {
|
||||
options.body = JSON.stringify(data);
|
||||
}
|
||||
return options;
|
||||
};
|
||||
// Set Http methods
|
||||
return {
|
||||
get: (path) => fetch(path, getOptions('GET')),
|
||||
post: (path, data) => fetch(path, getOptions('POST', data)),
|
||||
put: (path, data) => fetch(path, getOptions('PUT', data)),
|
||||
delete: (path) => fetch(path, getOptions('DELETE')),
|
||||
};
|
||||
})();
|
||||
//# sourceMappingURL=http.js.map
|
||||
Reference in New Issue
Block a user