Open helenzhou6 opened 6 years ago
I would ideally use the querystring module to handle grabbing what the user has inputted from the endpoint
For example for an endpoint of /search/?q=topic In your `handler.jsz file do:
/search/?q=topic
const querystring = require("querystring");
let searchedInput = querystring.parse(query)['/search/?q'].toLowerCase().trim();
To deal with spaces, punctuation, casing and random user inputted spaces
I would ideally use the querystring module to handle grabbing what the user has inputted from the endpoint
For example for an endpoint of
/search/?q=topic
In your `handler.jsz file do:const querystring = require("querystring");
let searchedInput = querystring.parse(query)['/search/?q'].toLowerCase().trim();
To deal with spaces, punctuation, casing and random user inputted spaces