express static Flashcards

1
Q

What does express.static() return?

A

files that are in the root, or specified directory

MIDDLEWARE FUNCTION

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the local __dirname variable in a Node.js module?

A

directory (file) name of current module’s absolute path

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does the join() method of Node’s path module do?

A

method joins all given path segments together.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does fetch() return?

A

returns a promise that resolves with a json method of the response object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the default request method used by fetch()?

A

get request

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How do you specify the request method (GET, POST, etc.) when calling fetch?

A

specify in the options parameter by setting the method: property.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

When does React call a component’s componentDidMount method?

A

after the render method

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Name three React.Component lifecycle methods.

A

Constructor()
render()
componentDidMount()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How do you pass data to a child component?

A

pass an array of objects to state

How well did you know this?
1
Not at all
2
3
4
5
Perfectly