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