V3 Rendering static files in Motion Server

Follow this guide to render your custom static HTML pages in your Motion server.

This enables you to serve HTML pages without the need to install and configure additional HTTP servers like Apache. 

Motion is based on NodeJS server side platform and uses ExpressJS framework for rendering HTML files.

Express uses the URL of a request to determine the file system location from which to serve the static files.


To display your static page place your static files under /var/opt/motion2/www


Please create www directory under /var/opt/motion2 if it doesn't already exist and assign it the proper permissions: 755 (owner: motion, group: motion)



Now, a request from http://your-motion-ipaddress/www/{staticfile} would result in the file /var/opt/motion2/www/{statisfile} being server to the requesting client


Example: if you place an HTML file named custom.html under /var/opt/motion2/www directory

custom.html
<html>
  <body>
     Hello World
  </body>
</html>


The file will now be loaded as shown below if you put http:/your-motion-ipaddress/www/custom.html in your browser



You can also create a trigger and use Motionbar or Browser CTI URL actions to automatically open your custom static page when agents receive or make a call.


Congratulations, you can now render your custom HTTP pages!!!