cors
This commit is contained in:
parent
40ed4d2e27
commit
f3635df333
3 changed files with 22 additions and 1 deletions
4
main.js
4
main.js
|
@ -1,5 +1,6 @@
|
|||
const express = require('express')
|
||||
const sqlite3 = require('sqlite3')
|
||||
const cors = require('cors')
|
||||
const app = express()
|
||||
const db = new sqlite3.Database(':memory:');
|
||||
|
||||
|
@ -12,7 +13,7 @@ db.serialize(() => {
|
|||
time TEXT
|
||||
)`);
|
||||
});
|
||||
|
||||
app.use(cors());
|
||||
app.get('/', async (req, res) => {
|
||||
const url = req.query.url;
|
||||
|
||||
|
@ -73,6 +74,7 @@ app.get('/', async (req, res) => {
|
|||
res.status(500).send("damn");
|
||||
return;
|
||||
}
|
||||
res.
|
||||
res.contentType("application/json");
|
||||
res.header("cache", "wasnt");
|
||||
res.send(resp)
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"cors": "^2.8.5",
|
||||
"express": "^4.21.1",
|
||||
"sqlite3": "^5.1.7"
|
||||
}
|
||||
|
|
|
@ -8,6 +8,9 @@ importers:
|
|||
|
||||
.:
|
||||
dependencies:
|
||||
cors:
|
||||
specifier: ^2.8.5
|
||||
version: 2.8.5
|
||||
express:
|
||||
specifier: ^4.21.1
|
||||
version: 4.21.1
|
||||
|
@ -136,6 +139,10 @@ packages:
|
|||
resolution: {integrity: sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==}
|
||||
engines: {node: '>= 0.6'}
|
||||
|
||||
cors@2.8.5:
|
||||
resolution: {integrity: sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==}
|
||||
engines: {node: '>= 0.10'}
|
||||
|
||||
debug@2.6.9:
|
||||
resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==}
|
||||
peerDependencies:
|
||||
|
@ -486,6 +493,10 @@ packages:
|
|||
engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0}
|
||||
deprecated: This package is no longer supported.
|
||||
|
||||
object-assign@4.1.1:
|
||||
resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
|
||||
object-inspect@1.13.2:
|
||||
resolution: {integrity: sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==}
|
||||
engines: {node: '>= 0.4'}
|
||||
|
@ -868,6 +879,11 @@ snapshots:
|
|||
|
||||
cookie@0.7.1: {}
|
||||
|
||||
cors@2.8.5:
|
||||
dependencies:
|
||||
object-assign: 4.1.1
|
||||
vary: 1.1.2
|
||||
|
||||
debug@2.6.9:
|
||||
dependencies:
|
||||
ms: 2.0.0
|
||||
|
@ -1275,6 +1291,8 @@ snapshots:
|
|||
set-blocking: 2.0.0
|
||||
optional: true
|
||||
|
||||
object-assign@4.1.1: {}
|
||||
|
||||
object-inspect@1.13.2: {}
|
||||
|
||||
on-finished@2.4.1:
|
||||
|
|
Loading…
Reference in a new issue