How can i get the list of countries for signup form in mern stack?

246 Views Asked by At

I am building one project based on the MERN stack. I got stuck in a signup form, it has one field of country. So, how could I get the list of countries or guide me any way by which I could achieve this?

1

There are 1 best solutions below

0
Victor Jozwicki On BEST ANSWER

You'd either have to have the countries in your backend on an URI you could ask from the frontend (GET /countries/) and display them.

Or have them directly in the frontend in a .json file and .map() it to display the options/autocomplete.

Can't help you more without code or more precision though.