Skip to content

khanhicetea/mini-web-counter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mini Web Counter

Everything should be measurable !

Installation

$ yarn
$ node main.js

Environments

  • REDIS_HOST : redis hostname (127.0.0.1)
  • REDIS_PORT : redis port (6379)
  • HMAC_SECRET : hmac md5 algo secret
  • ONLINE_WINDOW : window time period of online users
  • HTTP_PORT : http server port

How to use

$.getJSON("http://[your-web-counter]/hit/[webid-number]/[hmac-signature]", function( data ) {
	console.log(data);
	// Use data to render to UI
});

Or

$.ajax({
	url: "http://[your-web-counter]/hit/[webid-number]/[hmac-signature]",
	dataType: "jsonp",
	jsonpCallback: "[callback_function_name]",
}, function( data ) {
	console.log(data);
	// Use data to render to UI
});

LICENSE

The MIT License (MIT)

Copyright (c) 2018 Khanh Nguyen

About

Mini Web Counter, built on NodeJS, Redis

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published