[ Prev ]
2017-05-03

-- May 3 In-Class Exercise
var express = require('express')
 var app = express()
 app.get('/', function (req, res) {
   res.send('<form action="/index.php"><input type="submit" name="Submit" value="Submit"></form>')
 })
 app.get('/hw4', function (req, res) {
   res.send('<h1>Score of Hw4</h1>')
 })
 app.listen(8888, function () {
   console.log('Server up!')
 })
(Edited: 2017-05-03)
var express = require('express') var app = express() app.get('/', function (req, res) { res.send('<form action="/index.php"><input type="submit" name="Submit" value="Submit"></form>') }) app.get('/hw4', function (req, res) { res.send('<h1>Score of Hw4</h1>') }) app.listen(8888, function () { console.log('Server up!') })

-- May 3 In-Class Exercise
 var express = require('express')
 var app = express()
// can add different routes
 app.get('/', function (req, res) {
   res.send('<form method="post" action="/something"><input type="submit" 
 name="something" value="something"></form>')
 })
 app.post('/something', function (req, res) {
   res.send('<h1>Something handled</h1>')
 })
 app.listen(8888, function () {
   console.log('Express app which listens to port 8888')
 })
(Edited: 2017-05-03)
var express = require('express') var app = express() // can add different routes app.get('/', function (req, res) { res.send('<form method="post" action="/something"><input type="submit" name="something" value="something"></form>') }) app.post('/something', function (req, res) { res.send('<h1>Something handled</h1>') }) app.listen(8888, function () { console.log('Express app which listens to port 8888') })

-- May 3 In-Class Exercise
Name: Harita Shroff
var express = require('express')
 var app = express()
 app.use('/', express.static(__dirname))
 app.get('/', function(req, res)
 {
	res.send('<form action="/something" method="post"><input type="submit" 
 name="something" value="something" /></form>')
 })
 app.post('/something', function (req, res) {
    res.send('<h1>Something handled</h1>')
 })
 app.listen(8888, function() {
	console.log('Server up!!')
 })
(Edited: 2017-05-03)
Name: Harita Shroff var express = require('express') var app = express() app.use('/', express.static(__dirname)) app.get('/', function(req, res) { res.send('<form action="/something" method="post"><input type="submit" name="something" value="something" /></form>') }) app.post('/something', function (req, res) { res.send('<h1>Something handled</h1>') }) app.listen(8888, function() { console.log('Server up!!') })
2017-05-15

-- May 3 In-Class Exercise
Name: Bryan Nguyen, Jack Wanke, Richard Papalia, Kyle Escott
NUMBER 10)
var body = document.getElementsByTagName("body"); //returns array
body[0].addEventListener("orientationchange", function(event) {
if (event.orientation === -90 || event.orientation === 90) 
{
   console.log("Landscape");
}
else {
console.log("Portrait");
}
}
Name: Bryan Nguyen, Jack Wanke, Richard Papalia, Kyle Escott NUMBER 10) <pre> var body = document.getElementsByTagName("body"); //returns array body[0].addEventListener("orientationchange", function(event) { if (event.orientation === -90 || event.orientation === 90) { console.log("Landscape"); } else { console.log("Portrait"); } } </pre>
X