ka1kuk commited on
Commit
3d6aaff
1 Parent(s): e1f90a1

Delete server.js

Browse files
Files changed (1) hide show
  1. server.js +0 -41
server.js DELETED
@@ -1,41 +0,0 @@
1
- const app = require("express")();
2
-
3
- const chromium = require('chrome-aws-lambda');
4
- const puppeteer = require('puppeteer-core');
5
-
6
- app.get("/", (req, res) => {
7
- res.send('Hello AuthCode')
8
- })
9
-
10
- app.get("/api", async (req, res) => {
11
- const browser = await puppeteer.launch({
12
- args: chromium.args,
13
- executablePath: process.env.CHROME_EXECUTABLE_PATH || await chromium.executablePath,
14
- headless: true,
15
- });
16
-
17
- const page = await browser.newPage();
18
-
19
- await page.goto("https://liaobots.work/");
20
- await page.click('label.button');
21
- await page.waitForNavigation();
22
- await page.waitForTimeout(2000);
23
-
24
- // Execute JavaScript code in the context of the page
25
- const value = await page.evaluate(() => {
26
- // Retrieve the value from localStorage
27
- return localStorage.getItem('authCode');
28
- });
29
-
30
-
31
- await browser.close();
32
-
33
- res.send(value);
34
-
35
- });
36
-
37
- app.listen(process.env.PORT || 3000, () => {
38
- console.log("Server started");
39
- });
40
-
41
- module.exports = app;