-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.js
35 lines (23 loc) · 818 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
const express = require("express");
const cors = require("cors");
import {
handleRequestTest,
handleRequestGML,
handleRequestGPT4,
handleRequestGML4ForPaperGpt,
handleRequestZw
} from "./utils/functions";
const app = express();
app.use(express.json());
app.use(cors()); // Enable All CORS Requests
app.options('*', cors()) // Enable CORS preflight for all routes 测试跨域的时候开启这个地方
//Ending points
app.get("/handleRequestTest", handleRequestTest);
app.post("/handleRequestGML", handleRequestGML);
app.post("/handleRequestGPT4", handleRequestGPT4);
app.post("/handleRequestGML4ForPaperGpt", handleRequestGML4ForPaperGpt);
app.post("/handleRequestZw", handleRequestZw);
//Functions write here
app.listen(3000, function () {
console.log("Server is running on port 8080");
});