Skip to content

Example Node.js client server with AJAX and JSON.

Notifications You must be signed in to change notification settings

rsa408/NodeClientServer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NodeClientServer

Example Node.js project that illustrates client server exchanges using AJAX with JSON data.

The project "requires" only 'http', 'path', and 'fs'. It uses jQuery, knockout, and w3.css.

The code is written in TypeScript.

The client index.html page has 3 edit boxes that hold numbers to be sent to a 'calculate' function on the server. There is a 'result' box, and a 'Calculate' button.

When the calculate button is pressed, the 3 values are collected into a JSON object and sent to the server via AJAX. The server adds the 3 values together and returns the sum, which is displayed on the web page.

BONUS FEATURE

Added window resize to 'client/index.ts' so that if the browser is started as a new window in application mode, the window will become smaller to fit the user interface. There will be no tabs, bookmarks, etc.

You can start chromium or Chrome from the command line to do this:

chromium-browser --new-window --app=http://192.168.1.80:8080/index.html

About

Example Node.js client server with AJAX and JSON.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • CSS 78.2%
  • TypeScript 18.2%
  • HTML 3.6%