Skip to content

Commit

Permalink
build: prepare for vercel (#388)
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m authored Jan 11, 2023
1 parent ac98dcd commit 051554d
Show file tree
Hide file tree
Showing 6 changed files with 1,642 additions and 24 deletions.
23 changes: 23 additions & 0 deletions api/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
const { createNodeMiddleware, createProbot } = require("probot");

const app = require("../app");
const probot = createProbot();
const middleware = createNodeMiddleware(app, { probot });

/**
* Redirect `GET /` to `/stats`, pass `POST /` to Probot's middleware
*
* @param {import('@vercel/node').NowRequest} request
* @param {import('@vercel/node').NowResponse} response
*/
module.exports = (request, response) => {
if (request.method !== "POST") {
response.writeHead(302, {
Location: "/stats",
});
response.end();
return;
}

middleware(request, response);
};
File renamed without changes.
Loading

1 comment on commit 051554d

@vercel
Copy link

@vercel vercel bot commented on 051554d Jan 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

app – ./

app-coral-psi.vercel.app
app-first-timers.vercel.app
app-git-main-first-timers.vercel.app

Please sign in to comment.