Routers & Templates Quiz

DongJun·2023년 10월 3일

Today-I-Learn

목록 보기
24/40

QUESTION 1 OF 15
CORRECT
A router helps us divide URLs in small ‘mini-applications’

Yes.
QUESTION 2 OF 15
CORRECT
How can I make a router called productsRouter?

const productsRouter = express.Router()
QUESTION 3 OF 15
CORRECT
How can I use the productsRouter for the /products URL prefix?

app.use("/products", productsRouter)
QUESTION 4 OF 15
INCORRECT
How can I create a get router inside of productsRouter for the /products URL?

productsRouter.get("/products", fn)
YOUR ANSWER
productsRouter.get("/", fn)
CORRECT ANSWER
QUESTION 5 OF 15
CORRECT
If I have export default B on A.js I can import B using

import Z from "./A.js"
QUESTION 6 OF 15
INCORRECT
If I have export B on A.js I can import B using

import B from "./A.js"
YOUR ANSWER
import {B} from "./A.js"
CORRECT ANSWER
QUESTION 7 OF 15
CORRECT
A .js file can have more than one default export.

No.
QUESTION 8 OF 15
CORRECT
A .js file can have many export const ....

Yes.
QUESTION 9 OF 15
CORRECT
On this URL: /products/:category/:id what are the parameters?

id, category
QUESTION 10 OF 15
CORRECT
How can I make my URL have a ‘id’ parameter?

/products/:id
QUESTION 11 OF 15
CORRECT
On my controller, how can I access id on this URL /products/:id

req.params.id
QUESTION 12 OF 15
CORRECT
To return HTML to the user we need to use templates, it's the only option.

No.
QUESTION 13 OF 15
CORRECT
Pug is the only template engine we can use with Express.

No.
QUESTION 14 OF 15
CORRECT
A template engine takes sexy code and turns it into normal HTML.

Yes.
QUESTION 15 OF 15
CORRECT
What is the name of the folder where Express looks for the templates by default?

'/views'

profile
성장하기위한 나만의 방법을 꾸준히 찾는중! 협동적 & 성실한 Frontend 개발자를 목표로…

0개의 댓글