Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

126
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda