Skip to content

Latest commit

 

History

History

routeServer

routeServer

Another example Express application. Uses Max to do the routing and build the HTML.

Note: Before you run this example, make sure that you run the npm install embedded into the patcher file, by clicking on the [script npm install] message.


Files

routeServer.maxpat : The Max patch to run the example.
max_routeServer.js : The launcher JS for the NodeJS script.
app.js : The NodeJS/Express script that runs the application.
package.json : The Node package file.
README.md : This file!

Folders

/public : The browser-facing content served up by Node.
/routes : The Express routing functions for each endpoint.
/views : The HTML/EJS templates used by the routing functions.
/external : The files that are not JS/HTML/CSS. /js : The JavaScript helper/utility files.


Usage

  1. Launch the routeServer.maxpat.
  2. (First time only...) Click on the [script npm install] message at the upper-right to load the required packages and libraries.
  3. Click on the [script start] message at the top-left to start the Node process running.
  4. Launch a browser, and type in the URL "localhost:3000". You should see a simple index page.
  5. If you type in the URL "localhost:3000/makeData", you should see some data.
  6. If you type in the URL "localhost:3000/makeHTML", you should see some HTML, generated by Max, containing a value from Max.