stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
Week 9: NodeJS + Express + Git flows Flashcards | StudBud
Explore
/
Week 9: NodeJS + Express + Git flows
Week 9: NodeJS + Express + Git flows
20 terms
·
StudBud Administration
·
50 plays
Imported from external platform
Flashcards
20 cards
F
Practice quiz
P
Host live
L
Questions
20
Answers
1
What is
middleware
in Express?
A way of handling authentication/authorization
A library that allows Express to serve static files
Software that can be installed that runs between the client and server
Functions that are run by Express when a request is made to a route
2
How do you export modules in a Node.js environment?
export default _____
module.exports = _____
export _____
node.exports = {_____}
3
What is Express?
A built-in function in JS
A JS HTTP client library
A library used for scraping websites
A server-side framework for Node
4
How do you import modules in a Node.js environment?
include('moduleNameOrPath');
require('moduleNameOrPath');
import {moduleNameOrPath};
import 'moduleNameOrPath';
5
Which command will both fetch & merge new changes from a remote branch into a local repository?
git pull origin <branch-name>
git fetch
git merge <branch-name>
git checkout
6
Why is it important for Node to handle asynchronous code?
It is unknown when a user will click on a button
Node is used for more important tasks when running as a server
Operations like requests and reading/writing files can take a long time
Web servers must handle multiple clients efficiently
7
What is a design pattern?
Best practices used when designing user interfaces
A pattern used when designing web applications
A common way of structuring a solution to a problem
A strategy for developing effective algorithms
8
When another developer pushes their changes to the remote repo (e.g. on GitHub), your local repo also gets updated.
True
False
9
Which code snippet is required in order for Express to receive requests?
app.ready(8080)
app.listen('8080')
app.listen(8080)
app.server(8080)
10
What does MVC stand for?
Make View Controller
Model View Controller
Model Values Controller
Model View Computing
11
What is the correct git command for creating a new branch in your repository?
git add <branch-name>
git switch -b <branch-name>
git checkout -b <branch-name>
git add --branch <branch-name>
12
What do all Express routes require?
get, location, response
action, end-point, request-response
method, path, callback
method, URL, output
13
Which of the following are valid response methods in Express?
send, receive, reply
json, xml, html
send, json, render
status, respond, json
14
When starting a new project, what command is used to create a package.json file?
git init
npm -v
git add package.json
npm init
15
What is Node?
A development environment for running programs in any language
A program for creating interactive console-style games
An asynchronous, event-driven environment for running JS
A program that is used exclusively for creating web servers in JS
16
How can you fix a Pull Request from branch-A to main that is unable to merge due to a conflict?
You cannot fix this type of merge conflict
In your A branch: run git pull, resolve conflicts, then push back to main
In a new branch, copy & paste changes, then create a new PR to main on GH.
Pull updates on main, merge into A, resolve conflicts, commit, push to GH
17
What is package.json used for?
Nothing, it is an optional file
Tracking required libraries, scripts, and project information
Version control of project source code
Storing comments about the history of a project
18
Given the following URL, what will
req.query
be in Express?
{domain: 'localhost', port: '8080', city: 'toronto', year: '2018'}
['toronto', '2018']
None of the above
{city: 'toronto', year: '2018'}
19
Which of the following correctly configures Express to handle data sent from the client through a POST request?
app.use(express.body())
app.use(express.json())
app.use(req.body)
app.use(express.static('/post'))
20
Given two branches, what happens if you git merge a branch "B" into a branch "A"?
Git tries to bring changes from B into A. B branch wins any conflicts
Git tries to bring changes from B into A. Conflicts are handled by user
The files from B will overwrite the files in A, and branch B is deleted
The files from B will overwrite the files in A