Web/Apps 2018

Node.js is best used for:
CPU intensive applications
Scalable network applications
Relational database applications
All of the above
According to the NodeSource article, what problem arises from "long polling"?
Latency
Increases server load
Needs to work synchronously
We register the event handlers in a React client in the life cycle method componentWillMount
True
False
In addition to Node's http server what else are we hooking socket.io into the server
Error middleware
Builtin middleware
Dotenv
Express
Refreshing the browser causes a disconnect to fine the server
True
False
If you're going to handle databases with Node.js, what other software should you include?
Message queing
REST infastructure
Caching
Text messaging
If we want to send a message to all clients in a room, we could use this syntax on the server: io.to('someroom').emit('somemessahe',..
True
False
What syntax do we provide in app.js to contain all subsequent socket.io event emitters and handlers?
Let io = socketIO(server)
Io.on('connection', (socket) => {..
Var socket = io()
Let server = http.createServer(app)
After a connection was established, what event did the client first fire?
Request
Respond
Join
Welcome
What package(s) were installed to support socket IO?
Socket.io-server
Socket.io-client
Socket.io
Which type of applications should you use a traditional web server like ASP.Net MVC for?
Realtime/Chat
Relational Db
Heavy server side computations
Proxy
Non relational db
How many connection can a typical web server handle?
400
4000
1 million
2000
How many connections can a node.js server handle?
1 million
4000
2 million
200
Describe how socket.io works in conjunction with an http server
It just "attaches" to the server as middleware
It acts as the http server
It calls the server as a client
In addition to the http server what framework are we hooking socket.io into?
Express
Node.js
Socket.io-server
AJAX
On the client, what is the “global socket variable” known as?
EventHandler
EventEmitter
.env
Event
What method is used on both the client and the server to invoke an event?
Attach
Emit
Connect
What is the npm package name for the socket io version we’re using?
Socket.io
Socket
What is Heroku?
A cloud platform that lets companies build, deliver, monitor and scale apps
A command line tool for Git
A package manager
What software did we install to support the Heroku environment?
GitBash
Hekoku Toolbelt/CLI
Express
Commander
AJAX
What git command is used to create a new archive?
Git init
Git status
Git add .
Git commit
What git command tells us what files need to be added to the archive?
Git init
Git status
Git add .
Git commit
What git command will add all files to the archive?
Git init
Git status
Git add .
Git commit
What git command will finalize the adding of files to the archive?
Git init
Git status
Git add .
Git commit
What adjustments are required before we port our app to Heroku?
Change the address the component connects too
Run the React build script
Run the React start script
Rename all the components
Log out to Heroku
What does SSH Keys stand for?
Secure Shell Keys
Super Slippery Honey Keys
Secure Secret Host Keys
What is the purpose of an ssh key?
Ensures that unauthorized users cannot place files in our Heroku
Ensures that your app is public on Heroku
Ensures that unauthorized users can't see your new app
What time zone does Heroku us by default?
EST
GMT
MDT
MGMT
What Heroku command do we use to change the time zone?
Heroku config:add TZ="America/Detroit" --app yourname-appname
Heroku config:add TZ="America/Detroit" --time xxxxxx-traficlights
Git config:add TZ="America/Detroit" --app xxxxxx-traficlights
What does the floor method do?
Rounds a number up to the nearest integer
Rounds a number down to its nearest integer
How would you return a random number between 1 and 10?
Math.random((Math.floor() * 10) + 1)
Math.floor((Math.random() * 10) + 1)
Math.floor((Math.random())
Math.floor((Math.random() * 10)
How do we render random colors in our casestudy?
Very carefully
Using the math functions to generate a random index of a color in a json file
Using the math functions to generate 6 random chars and append them to be a random hex value
Using the random color function
What library do we use to format times in our casestudy?
Moment.js
Momma.js
Socket.io
Time.js
Now.js
How would you use format the current time as 4:47:39 pm?
Moment().format('h:mm:ss a')
Now().format('h:mm:ss a')
Moment().now().format(hour minute second)
Moment().format('h.m.s.a')
What syntax is used by the client to establish a connection to a server in socket.io?
Const socket = io.connect();
Io.on('connection', (socket) =>
This.state.socket.emit('connection',
Socket.on('connection', this.connection);
What syntax is used by the server to handle the connection of a client?
Const socket = io.connect();
Io.on('connection', (socket) =>
This.state.socket.emit('connection',
Socket.on('connection', this.connection);
What syntax is used on the server to join a particular room?
Socket.join(clientData.roomName);
Socket.on('join', (clientData) =>
Io.on('join', (socket) =>
What syntax is used on the server to send a message to a single user?
Io.to(socket.id).emit('welcome', msg) ;
Socket.broadcast.to(clientData).emit('welcome', msg);
Io.emit('currentusers', userinfo )
What syntax is used on the server to send a message to all users in the room?
Io.to(socket.id).emit('room', msg) ;
Socket.broadcast.to(clientData.roomName).emit('joined', msg);
Io.emit('currentusers', userinfo )
What syntax is used on the server to send a message to all users in all rooms?
Io.to(socket.id).emit('newMsg', msg) ;
Socket.broadcast.to(clientData.roomName).emit('joined', msg);
Io.emit('currentusers', userinfo )
What React lifecycle method is used to register event handlers for socket.io server generated messages?
ComponentDidMount
Constructor
Connect
What syntax is used in the method to register a method for a server generated ‘welcome’?
Socket.io('welcome', this.onWelcome);
Socket.on( this.onWelcome, 'welcome');
Socket.io(this.onWelcome, 'welcome');
Socket.on('welcome', this.onWelcome);
What does CORS stand for?
Control Origin Region System
Cross-Origin Resourcing Sharing
Code Optimization Resource Sharing
What three headers do we have to set to fix CORS errors?
Access-Control-Allow-Origin
Access-Control-Allow-Method
Access-Control-Allow-Content
Access-Control-Allow-Json
Access-Control-Allow-Headers
Access-Control-Allow-Options
How did we distinguish between individual
Key attribute
User attribute
ViewDialog attribute
Users attribute
How was the individual user's data made available in the
Key attribute
User attribute
ViewDialog attribute
Users attribute
What 3 Material-UI components was the example
Toolbar
IconButton
ToolbatTitle
Button
Streetlight
How does the
Key attribute
User attribute
ViewDialog attribute
Users attribute
What does this line of .css code do: height: calc(80vh - 70px);
Calc is how you do math in css
80vh divides the current viewport and use 80/100 of it regardless of what device we're on
80 px past the center - 70 px
Only sets the height for vh devices
What does PWA stand for?
Public Web App
Peng Wan App sun
Progressive Windows App
Progressive Web App
What sort of information is in a web manifest?
Citations
Author
Icon
Date
Name
What is the purpose of the web manifest?
to install web applications to the homescreen of a device
To please evan laureson
A package file
What is a service worker?
AppCache
A server slave
Business speak for a web developer
A script that your browser runs in the background, separate from a web page
What are we using our service worker for?
To boost our PWA score
To create a custom offline page
To manage the server
Performance
{"name":"Web\/Apps 2018", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"Node.js is best used for:, According to the NodeSource article, what problem arises from \"long polling\"?, We register the event handlers in a React client in the life cycle method componentWillMount","img":"https://www.quiz-maker.com/3012/images/ogquiz.png"}
Powered by: Quiz Maker