You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is an array of all the tags found via a selector
Responses
By default, when a SELECTOR is queried the entire Array<Object> of the specified selector must be sent back without the attributes. The response will look something like this:
Remember, Selectors can be nested. In this case, simply return the an Object with the selectors contained within the selector. The format of the response for a nested selector will be like so.
Notice the circular nature of this type. This means a SELECTOR can have arbitrary levels of nesting,
in production we will limit the nesting to < 32 levels as it is the limit for Firebase Realtime Database.
With Attributes
Specific attributes may be requested via query parameters like so.
Route REST URL to parsed data
We must parse a URL to is appropriate resource. Here is what the URL would look like.
Here is what the resources look like in the DB.
USER_ID
: Ignore for now. Fix that to the valueUserA
RESOURCE_ID
: Id of the webpage to access.-
SELECTOR
: The specific selector to access.Here is what an
Array<Object>
looks like in the DB.It is an array of all the tags found via a selector
Responses
By default, when a
SELECTOR
is queried the entireArray<Object>
of the specified selector must be sent back without the attributes. The response will look something like this:Notice the empty
attributes
object.Nested Selectors
Remember, Selectors can be nested. In this case, simply return the an
Object
with the selectors contained within the selector. The format of the response for a nested selector will be like so.Where,
SELECTOR_A
contains the followingThe response will have the format:
or the type
Notice the circular nature of this type. This means a
SELECTOR
can have arbitrary levels of nesting,in production we will limit the nesting to < 32 levels as it is the limit for Firebase Realtime Database.
With Attributes
Specific attributes may be requested via query parameters like so.
The response must be in this format.
Notice that all objects within the
Array<Object>
are returned with specified keys.Notes
Error()
. We will replace this with a404
in the server later.RESOURCE_ID
is queried, return an in the format:Object<SELECTOR, Array<Object>>
Resolutions.ts
, write and export your function from there.To-do
Let me know if you need help.
The text was updated successfully, but these errors were encountered: