Skip to main content

Develop with FastTrack

Middle tier: Node.js Express

The example application communicates with MarkLogic through a Node.js Express server (the architecture's middle tier). The middle tier passes search requests to MarkLogic, returns search responses from MarkLogic, and applies HTTP headers to search requests to avoid any CORS obstacles. In a real-world application, the middle tier would also commonly handle authentication tasks. The UI will communicate with the middle tier through port 4001. 

  1. Install the middle-tier dependencies by running this command from the fasttrack-getting-started/server directory:

    npm install
  2. Start the middle-tier server by running this command:

    npm start
  3. The middle-tier server gets its configuration information from a file at server/config.js. This file can be edited if necessary.