Provide a CORS-Capable service.
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.
cors-service.maxpat
: The Max patch to run the example.
cors-service.js
: The launcher JS for the NodeJS script.
app.js
: The NodeJS/Express script that runs the application.
testpage.html
: A web page used to test the service.
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 endpoints.
/views
: The HTML/EJS templates used by the routing function.
- Launch the
cors-service.maxpat
Max patch. - (First time only...) Click on the [script npm install] message at the top-left to load the required packages and libraries.
- Click on the [script start] message at the top-left to start the Node process running.
- Click on the "Open the test page" message to launch a browser window with the example HTML page. Click on the button on that page to send a random number to the Max patch, and have it return a variety of Max-generated information.