Skip to content

Latest commit

 

History

History
 
 

appserver

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Backend - AppServer

AppServer is a node.js app which runs Anypixel apps from an Express server. This is what holds the canvas that your Anypixel app will draw on. Each frame it will send the pixel data from this canvas to ChromeBridge, where it will be sent on to the physical display itself. It also provides a RESTful API for changing the current app and for listing the available apps.

img

Getting Started

  1. Install node components - $ npm install

  2. Start the server - $ npm start

To stop the server, do $ npm stop

To add your own apps:
Copy your app folder into /public/apps and make sure you have an index.js file in your root app directory.

API

Get App

Renders an HTML page containing the requested app.

  • URL:
    /app/:app_name

  • Method:
    GET

  • URL Parameters:
    app_name=[string]

  • Success Response:

    • Code: 200
      Content: Rendered EJS template HTML containing the requested app.
  • Error Response:

    • Code: 404
      Content: Invalid app name

Get Available Apps

Returns an array of the valid app names and directories

  • URL:
    /api/apps

  • Method:
    GET

  • URL Parameters:
    None

  • Success Response:

    • Code: 200
      Content:
    {
         success: true,
         apps: [
     	    {
     		    name: "My App",
     		    path: "myApp"
     	    }
        ]
    }
    
  • Error Response:
    None