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