This is the official API of BACKTICK APP.
The basic resources are following-
- College
- Department
- Class
- Student
- Staff
- Post
- Comment
- Announcement
This API follows REST terminology.
You can view endpoints of different resources in routes folders inside their respective folders
This document explains how to add a post and like a particular post, ALL REAL-TIME.
To see it in action, Open project link in two seperate windows and try adding a new post or like existing one.
This event returns the newly created post. Post has following attributes - _id, text, postedAt, likes
Example
socket.on('new-post', function(data){
console.log(data);
});
This event return the number of likes of a post after a post has been liked along with its _id. It has following attributes = _id, likes
Example
socket.on('post-liked', function(data){
console.log(data);
//let span = document.getElementById('span'+data._id);
//span.innerText = 'Likes: '+data.likes;
});
This event adds a new post. It needs 'text' as a parameter to emit.
Example
socket.emit('add-post', {text: 'hello'});
This event likes a post. It needs 'id' of the post as a parameter.
Example
socket.emit('like-post', id);