This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'); | |
// Creates new Server object | |
// and takes a callback as param. | |
// The callback is an event listener; | |
// When server emits particular event, | |
// this function will be called. | |
// Callback takes 2 parameters, | |
// request (type IncomingRequest) | |
// and response (type ServerResponse). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'); | |
var fs = require('fs'); | |
http.createServer(function(req, res) { | |
// Specify html content type | |
res.writeHead(200, { 'Content-Type': 'text/html' }); | |
// Read contents of index.htm file synchronously, | |
// Saved as string in var html | |
var html = fs.readFileSync(__dirname + '/index.htm'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head></head> | |
<body> | |
<h1>Jelly Filled Donut</h1> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'); | |
var fs = require('fs'); | |
http.createServer(function(req, res) { | |
// Specify html content type | |
res.writeHead(200, { 'Content-Type': 'text/html' }); | |
// Read contents of index.htm file synchronously, | |
// Saved as string in var html. | |
// Use 'utf8' param to specify encoding and ensure you are |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head></head> | |
<body> | |
<h1>{Message}</h1> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'); | |
var fs = require('fs'); | |
http.createServer(function(req, res) { | |
// Specify html content type | |
res.writeHead(200, { 'Content-Type': 'text/html' }); | |
// Replaced readFileSync and end with createReadStream. | |
// Read contents of index.htm and pipe to writeable stream res. | |
// Keeps buffer small, sends data a chunk at a time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* THESE ARE USED TO ALIGN DASHBOARD COLUMNS */ | |
.tenant-info { | |
margin-bottom: 10px !important; | |
flex: 1; | |
} | |
.tenant-info-inner { | |
height: 100%; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'); | |
// Middleware to parse body of HTTP requests | |
var bodyParser = require('body-parser'); | |
// Invokes function returned from require. | |
// Creates an Express application; | |
// express() returns Express object | |
var app = express(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<link href="assets/style.css" type="text/css" rel="stylesheet"/> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js" ></script> | |
</head> | |
<body> | |
<h1>Jelly Filled Donut</h1> | |
<form method="POST" action="/person"> | |
First name: <input type="text" id="firstname" name="firstname" /> <br /> | |
Last name: <input type="text" id="lastname" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'); | |
var app = express(); | |
// Import the functions returned by apiController and htmlController | |
// to add endpoints/routes to app. | |
var apiController = require('./controllers/apiController'); | |
var htmlController = require('./controllers/htmlController'); | |
var port = process.env.PORT || 3000; |
OlderNewer