Skip to content

Commit fad8987

Browse files
committed
added route params to en.js so word lookup has more flexibility, allowing users to refine their word search with adjectives, nouns, sentences, verbs, etc.
1 parent 16a86ad commit fad8987

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

routes/en.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ router.get("/", function (req, res) {
2020
res.header("Strict-Transport-Security", "max-age=63072000");
2121
res.setHeader("Content-Type", "application/json");
2222

23+
const partOfSpeech = req.query.type;
24+
2325
axios({
2426
method: "GET",
25-
url: "https://randomword.com/",
27+
url: partOfSpeech ? `https://randomword.com/${partOfSpeech}` : `https://randomword.com`,
2628
headers: {
2729
"User-Agent": rua,
2830
},

0 commit comments

Comments
 (0)