JasonDuquain / Baby-Name-Generator

App to generate random baby names and can be configured by gender and region.
1 stars 0 forks source link

Dynamically add country names to the option elements #6

Open JasonDuquain opened 5 years ago

JasonDuquain commented 5 years ago

User Story:

Technical tasks required:

Difficulty Rating: 2

JasonDuquain commented 5 years ago

notes/lessons learned:

request({
            url: 'https://raw.githubusercontent.com/thm/uinames/master/uinames.com/api/names.json',
            json: true
        }, (error, response) => {
             let namesArray = response.body; //namesArray would not be available outside the request call
             res.render("baby/index", {
                 namesArray: namesArray
            });
});