![]() |
VOOZH | about |
Sr Technical Content Strategist and Team Lead
Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.
I help Businesses scale with AI x SEO x (authentic) Content that revives traffic and keeps leads flowing | 3,000,000+ Average monthly readers on Medium | Sr Technical Writer(Team Lead) @ DigitalOcean | Ex-Cloud Consultant @ AMEX | Ex-Site Reliability Engineer(DevOps)@Nutanix
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
I have may be a basic question, with the url, when I work on visual studio url it’s like https://localhost:3030/api/something but when I publish it’s like https://myserver:3030/api/something how can I handle this to avoid change url in all my functions because is hardcode basically
Hey, Sara, thanks for the article. There are some minor typos in Step 2 full code so it doesn’t work. I´ve checked and change a little bit and now it´s ok:
<h1>Authors</h1>
<ul id="authors">
</ul>
<script> const ul = document.getElementById(‘authors’); const list = document.createDocumentFragment(); const url = ‘https://jsonplaceholder.typicode.com/users/’;
fetch(url) .then((response) => { return response.json(); }) .then((json) => { json.map(function(author) { let li = document.createElement(‘li’); let name = document.createElement(‘h2’); let email = document.createElement(‘span’);
name.innerHTML = `${author.name}`;
email.innerHTML = `${author.email}`;
li.appendChild(name);
li.appendChild(email);
list.appendChild(li);
ul.appendChild(list);
});
})
.catch(function(error) {
console.log(error);
});
</script>
i created an account to say this. although the article is helpful the syntax highlighting is atrocious my eyes are bleeding please change the colors please
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.