Skip to content

15. Interface and Application Programming

Brainstorming

  • Processing
  • NodeJS

NodeJS

This week, I am going to try and learn more about Javascript and creating interfaces using NodeJS. I know a little bit, enough to get me into trouble, and so I would like to try and understand what is going on at a deeper level.

First, things first, need to install the node package manager (npm) on my computers. Not sure all of these will get used, but based on my research, these seem to be useful for my particular application.

brew install npm

brew install node

npm install serialport

npm install firmata

npm install http

npm install express

First NodeJS Application

I created my inital app using the NodeJS: Getting Started guide.

const http = require('http');

const hostname = '127.0.0.1';
const port = 3000;

const server = http.createServer((req, res) => {
  res.statusCode = 200;
  res.setHeader('Content-Type', 'text/plain');
  res.end('Hello World');
});

server.listen(port, hostname, () => {
  console.log(`Server running at http://${hostname}:${port}/`);
});

References

Processing

Files

References

MIT App Inventor

References


Last update: May 14, 2021