Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

121
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!