To start the development environment with all necessary services:
npm run start:devThis command will:
- Install all dependencies (both client and server)
- Start the server with auto-reload
- Start the client development server
- Handle automatic port selection if default ports are in use
npm run dev- Start both client and server in development modenpm run dev:server- Start only the server with auto-reloadnpm run dev:client- Start only the client development servernpm run dev:setup- Install all dependenciesnpm run dev:clean- Remove all node_modulesnpm run dev:reset- Clean and reinstall all dependenciesnpm run build- Build the client for production
The application automatically handles port selection:
- Server default port: 3001 (will automatically find next available port if in use)
- Client default port: 3000
You can configure the ports using environment variables:
- Server:
PORTenvironment variable - Client:
PORTenvironment variable (when starting the client)
Register origin domain address of your web page: https://api.gazerecorder.com/register/
<script src="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Ca+href%3D"https://api.gazerecorder.com/GazeCloudAPI.js" rel="nofollow">https://api.gazerecorder.com/GazeCloudAPI.js" ></script>Start eye tracking GazeCloudAPI.StartEyeTracking();
callback GazeCloudAPI.OnResult = function (GazeData) { GazeData.state // 0: valid gaze data; -1 : face tracking lost, 1 : gaze data uncalibrated GazeData.docX // gaze x in document coordinates GazeData.docY // gaze y in document coordinates GazeData.time // timestamp }
optional callbacks: GazeCloudAPI.OnCalibrationComplete =function(){ console.log('gaze Calibration Complete') }
GazeCloudAPI.OnCamDenied = function(){ console.log('camera access denied') }
GazeCloudAPI.OnError = function(msg){ console.log('err: ' + msg) }
Disable/Enable click recalibration GazeCloudAPI.UseClickRecalibration = true;
Simple Example: https://api.gazerecorder.com/