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

- this tutorial uses a middleware
- obtained data will be stored in
req.geolocationvariable - this tutorial extends
Controllerby addinggeolocation()method which returnsreq.geolocation
Create a definition file e.g. geolocation.js:
Usage
Now we extend routes where we want to use Geolocation.
Result:
Tips
- we can use a global middleware via
F.use('geolocation', '*', ['web']); - we can store geolocation data in cookies or in a database









