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

124
Visualizações
Discord Oauth2 for GitHub Pages?
var express = require('express')()
const app = express();
var port = {
  'client_id': '…',
  'client_secret': '…',
  'grant_type': 'authorization_code',
  'redirect_uri': '…',
}

app.get('/', (request, response) => {
  return response.sendFile('index.html', { root: '.' });
});

app.listen(port, () => console.log(`App listening at http://localhost:${port}`));
console.log('1')

How do I use Discord Oauth2 for GitHub Pages? It says that require is not defined. And even on local hosting, it says that I had to wrap the strings in array in require('express'). Then, it says that app.get is not a function.

And after all of this, how do I make a request to retrieve the servers of the person logged in?

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

0

GitHub Pages is a statically hosted hosting service, whilst Express is a server-side framework server.

GitHub Pages is a static site hosting service that takes HTML, CSS, and JavaScript files straight from a repository on GitHub, optionally runs the files through a build process, and publishes a website.

Source

This means that you cannot use Express with GitHub Pages. However, there are workarounds and alternatives.

Workaround: Load content client-side

This is the recommended route if you want to stick to GitHub Pages. You would have a static skeleton page given to the user and fill in the fields using JavaScript on the client.

There are multiple approaches to this method, however, it depends on how you are handling authentication.

Alternative: Use other hosting services

I assume that you are using GitHub Pages because it is a free hosting service, but the catch is that it's static only.

Both Vercel and Netlify have something called serverless functions. With serverless functions, a new computing instance is spun up every time a person makes a request to your website. Here are some official guides on how to implement Express:

  • Vercel (recommended)
  • Netlify

Good luck with your project!

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