-
Notifications
You must be signed in to change notification settings - Fork 1
Programming Phase III
This main target of the week is to fix any bugs related to API and complete the documentation. The entire documentation is divided into 5 sections namely: Auth, Users, Activities, Journal, and Stats.
* Auth
* Login User
* Signup User
* Users
* Get all users
* Get user detail
* Add user
* Update user
* Remove user
* Activities
* Get all activities
* Get activity detail
* Journal
* Get journal entries
* Add entry
* Update entry
* Remove entry
* Stats
* Get all stats
* Add Stats
* Remove stats
Every section has its own routes for performing crud operations.Auth APIs are unauthenticated and can be used for login and signup of the user. Rest of the APIs can be accessed only after authorization. The Final documentation is temporarily available at link.
Apart from the documentation, one of the bugs has confused me a lot and has yet to be fixed. It looks like as follows. This issue is environment dependent and is occurring on systems with specific configurations.
Uncaught Error: Can't set headers after they are sent.
To fix it, a hack was added in the middleware to prevent multiple header requests. (Source)
// header's fix
app.use(function(req, res, next) {
var _send = res.send;
var sent = false;
res.send = function(data) {
if (sent) return;
_send.bind(res)(data);
sent = true;
};
next();
});Next week focus would be on creating mockups for the Sugarizer Dashboard. Stay Tuned for more updates!