My accountGet started

Geolocation in Total.js

How to use Geolocation in Total.js framework? Localize each IP address in your web application.

Geolocation in Total.js

  • this tutorial uses a middleware
  • obtained data will be stored in req.geolocation variable
  • this tutorial extends Controller by adding geolocation() method which returns req.geolocation

Create a definition file e.g. geolocation.js:


Now we extend routes where we want to use Geolocation.



  • we can use a global middleware via F.use('geolocation', '*', ['web']);
  • we can store geolocation data in cookies or in a database