Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

161
Visualizações
How to find all directories in a directory in "vanilla js" (JS NOT PHP)

I am making a little set of 'apps' for my little brother (as a learning experience)

but i have a problem... I cant get a list of all the apps

this (of course) means i need to get all directories in a directory, but i made this in vanilla js and i don't know much about http requests

i will also be fine if you answer a way to use fs in the frontend

(if you click the links it is supposed to redirect you... that only works for me since i cant and dont need to put ALL the code)

const apps = ['foo', 'bar'] // this is where all the apps are supposed to be

const ul = document.querySelector("ul")
apps.forEach(app => {
    const el = document.createElement("li")
    
    el.innerHTML = `<a href="/apps/${app}">${app}</a>`

    ul.appendChild(el)
})
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@600&display=swap');

* {
    font-family: 'Open Sans', sans-serif;
    margin: 0;
    padding: 0;
    color: white;
    text-align: center;
    background-color: #333;
    border: none;
    font-size: large;
}

ul {
    margin-top: 5%;
}

li, a {
    list-style: none;
    text-transform: capitalize;
    text-decoration: none;
    margin-bottom: 1%;
    transition: color 500ms;
}

a:hover {
    color: gray;
}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="style.css">
    <link rel="icon" type="image/x-icon" href="favicon.ico">
    <script src="script.js" defer></script>
    <title>Webbed Tools</title>
</head>
<body>
    <ul></ul>
</body>
</html>

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Simply say, you can't. It's very bad practice if you do this for a frontend web app, because it can be a potential vulnerable in terms of security.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda