Abel Sanchez, John R. Williams

Slides:



Advertisements
Similar presentations
Part 2.  Arrays  Functions  Passing Variables in a URL  Passing variables with forms  Sessions.
Advertisements

© 2014 IBM Corporation Empowering the IBM ecosystem Introduction to Developing applications using node.js on Bluemix IBM Ecosystem Development Instructors.
Browsers and Servers CGI Processing Model ( Common Gateway Interface ) © Norman White, 2013.
Stanford University EH&S A Service Oriented Architecture For Rich Internet Applications Sheldon M. Heitz.
Gayle J Yaverbaum, PhD Professor of Information Systems Penn State Harrisburg.
RESTful Web Development With Nodejs and Express. REST Stands for REpresentational State Transfer Has the following constraints: ◦Client-Server ◦Stateless.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
User Interface Design using jQuery Mobile CIS 136 Building Mobile Apps 1.
Configuration Management and Server Administration Mohan Bang Endeca Server.
1 HTML Forms. 22 HTML forms provide a way for a user to send information back to the web server. Originally the user input was processed on the server.
Website Development with PHP and MySQL Saving Data.
Chapter 6 Server-side Programming: Java Servlets
Mainframe (Host) - Communications - User Interface - Business Logic - DBMS - Operating System - Storage (DB Files) Terminal (Display/Keyboard) Terminal.
1 © Netskills Quality Internet Training, University of Newcastle HTML Forms © Netskills, Quality Internet Training, University of Newcastle Netskills is.
Analysis of SQL injection prevention using a filtering proxy server By: David Rowe Supervisor: Barry Irwin.
Server-side Programming The combination of –HTML –JavaScript –DOM is sometimes referred to as Dynamic HTML (DHTML) Web pages that include scripting are.
 Previous lessons have focused on client-side scripts  Programs embedded in the page’s HTML code  Can also execute scripts on the server  Server-side.
Module: Software Engineering of Web Applications Chapter 2: Technologies 1.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
1 State and Session Management HTTP is a stateless protocol – it has no memory of prior connections and cannot distinguish one request from another. The.
CSC 2720 Building Web Applications Basic Frameworks for Building Dynamic Web Sites / Web Applications.
COSC 2328 – Web Programming.  PHP is a server scripting language  It’s widely-used and free  It’s an alternative to Microsoft’s ASP and Ruby  PHP.
Node.JS introduction. What is Node.JS? v8 JavaScript runtime Event driven Non-blocking standard libraries Most APIs speak streams Provides a package manager.
Introduction to Node.js® Jitendra Kumar Patel Saturday, January 31, 2015.
1 Using MVC 6. MVC vs. ASP Web Forms Both run under ASP.NET Can coexist In Web Forms, browser requests page. xxx.aspx and xxx.aspx.cs on the server Page.
Servlets What is a Servlet?
NodeJS and MEAN cs6320.
CS 330 Class 7 Comments on Exam Programming plan for today:
Introduction to Dynamic Web Programming
Node.js Express Web Applications
Node.js Express Web Services
Express with Node L. Grewe.
NodeJS and MEAN Prof. L. Grewe.
Web Software Model CS 4640 Programming Languages for Web Applications
CMPE 280 Web UI Design and Development October 26 Class Meeting
3 Things Everyone Knows About Node JS That You Don't
CMPE 280 Web UI Design and Development October 24 Class Meeting
CMPE 280 Web UI Design and Development October 26 Class Meeting
PHP / MySQL Introduction
Build Better Apps with MEAN.
CMPE 280 Web UI Design and Development January 30 Class Meeting
Week 04 (Final Project) Node.js Week 04 (Final Project)
Express with Node L. Grewe. Feature 1 Project structure.
CS 174: Server-Side Web Programming January 29 Class Meeting
NodeJS coding basics L. Grewe.
CMPE 280 Web UI Design and Development January 30 Class Meeting
Lecture 1: Multi-tier Architecture Overview
Web Programming Language
CMPE 280 Web UI Design and Development January 29 Class Meeting
Web Programming Language
Console Use. Console Use Exit Console Run File.
Lecture 17: Web Service and post
Lecture 16: Writing Your Own Web Service
RESTful Web Services.
Lecture 11: Node.JS February 16, 2018 Open twitter page, sphere-e page
Lecture 12: The Fetch Api and AJAx
World Wide Web Components
CSc 337 Lecture 1: post.
Lecture 14: JSON and Web SERVICES
PHP Forms and Databases.
Chengyu Sun California State University, Los Angeles
PHP-II.
<form> Handling
CSc 337 Lecture 18: post.
Chengyu Sun California State University, Los Angeles
MEAN login management CS252.
Lecture 15: Writing Your Own Web Service
CMPE 280 Web UI Design and Development August 27 Class Meeting
CMPE 280 Web UI Design and Development September 10 Class Meeting
Presentation transcript:

Abel Sanchez, John R. Williams Services Abel Sanchez, John R. Williams

Work Requires Connections Shipping Routes

Work Requires Connections Flight Routes

130 Trillion Pages * Google, https://www.google.com/intl/bn/insidesearch/howsearchworks/thestory/

Connecting Physical to Virtual

Connecting Contract to Virtual

Services for taxi-hailing application

What about academia?

Traditional View of Scholarship by cites Authors Article Articles

Today output of by Datacenter Code Developer used by used Authors Dataset From cites by cites Article used organization Big Data Articles Software Services Web Pages

The work continues to evolve Lavoie, Brian et al. 2014. The Evolving Scholarly Record. Dublin, Ohio: OCLC Research

How do I allow Bob to run my add function? The Sharing Problem How do I allow Bob to run my add function? Alice’s Laptop Alice Bob

Services

Node’s goal is to provide an easy way to build scalable network programs

Architectural Shift 1.old) web server with some application logic 1.new) app that can connect and collaborate 2.old) stateful 2.new) stateless

Architectural Shift 1.old) blocking 1.new) non-blocking 2.old) process per request 2.new) single process

MODULES

Use module with “require” Make module with “module.exports”

What is npm? https://www.npmjs.com Package manager. Installs, publishes and manages node programs

What is npm? Billion+ downloads per month

What is a Module? A Module is some JavaScript paired with a package.json file +

Advantages Small pieces, loosely joined Leverage external packages Leverage internal packages Facilitate collaboration Packages are discoverable in npm

Creating node/npm apps

“npm init” generates the configuration file package.json

adding npm packages to your application

Local installation of express package. Dependency added to package Local installation of express package. Dependency added to package.json

Hello World Server

Active Learning 1 Write a server that returns the current time new Date()

Pass Parameters Using Wildcards

Active Learning 2 app.get('/getUser/:id', function(req, res){ // -------------------------------------- // Your Code // Return id to client }); app.get('/user/:name/:id', function(req, res){ // Return id and name to client

Active Learning 3 Building on Active Learning 2, return user based on ”id”. Use the following data. var users = [ { id : '01', name: 'john', email: 'john@mit.edu'}, { id : '02', name: 'mary', email: 'mary@mit.edu'}, { id : '03', name: 'paul', email: 'paul@mit.edu'}, { id : '04', name: 'anna', email: 'anna@mit.edu'}, ];

Active Learning 4 Building on Active Learning 3, add a route to add users. Calls should add new user and return the full users array. app.get('/addUser/:id/:name/:email', function(req, res){ // -------------------------------------- // Your Code });

URL Query String parameter name property value URL http://www.site.com/page.html?parameter1=value1&parameter2=value2 Query String Begin Query String Separator Equal Sign

Pass Parameters Using Query String localhost:3000?name=abby&age=5&nickname=funny var queryString = req.query; console.log(queryString); var age = req.query.age; console.log(age);

Active Learning 5 Write a server route to extract URL query string parameters app.get('/', function(req, res){ // -------------------------------------- // Your Code });

HTTP POST var express = require('express'); var app = express(); app.use(express.static('public')); // used for form submissions var bodyParser = require('body-parser'); app.use(bodyParser.json()); app.use(bodyParser.urlencoded()); /* GET Registration Page */ app.get('/', function(req, res){     res.redirect('/signup.html'); }); /* Handle Registration POST - body-parser needed to parse form */ app.post('/signup', function(req, res){     var message = { "username" : req.body.username, "password" : req.body.password }; console.log(req.body); res.send(message); app.listen(3000);

HTML <!DOCTYPE html> <html> <form action="/signup" method="POST" >     Username:<br>     <input type="text" name="username"><br>     Password:<br>     <input type="text" name="password"><br>     <button type="submit">Submit</button> </form> </html>

Active Learning 5 Setup server

Publish npm module

First login to npm

Write module * Do not forget to add configuration data – npm init

Then publish

Q&A

Software Development Cycle