Published: Updated:

I realized that Google Analytics does not give me information that I want to have about my articles. Plus when I search for a solution in a day to day software developer problems I usually end up on StackOverflow, where I vote up the answer that helped me. Rarely I go to personal blogs, but I had a few examples where content on them was several levels better than I see on StackOverflow. But there is nothing to mark the website as great. I want such feature on my website.

For every page I am going to store votes in the database. How to get current page URL in GatsbyJS code? There is great article here, but it uses function components, while I stick with class-based components (good article about transition between them).

Solution 2

But as we live in Node.js world in the search for a simple solution you have to install more and more dependencies from npm. Here it is. It can be nicely wrapped for any component.

To specify user votes I need to get information from them. Some personal information like their IP address, information about their browser

Get IP address https://stackoverflow.com/a/35123097/1104612

But that is for future versions.

Current version is available on https://github.com/mikolasan/like-server

Rate this page