add cors
This commit is contained in:
parent
4a185304ae
commit
0d53e49d89
@ -1,16 +1,15 @@
|
|||||||
// index.js
|
// index.js
|
||||||
import Fastify from "fastify";
|
import Fastify from "fastify";
|
||||||
import fs from "fs";
|
|
||||||
import path from "path";
|
|
||||||
import RSS from "rss";
|
import RSS from "rss";
|
||||||
import TTLCache from '@isaacs/ttlcache';
|
import TTLCache from '@isaacs/ttlcache';
|
||||||
import '@dotenvx/dotenvx/config.js';
|
import '@dotenvx/dotenvx/config.js';
|
||||||
import { ApifyClient } from 'apify-client';
|
import { ApifyClient } from 'apify-client';
|
||||||
import { env } from './env.js';
|
import { env } from './env.js';
|
||||||
import packageJson from "./package.json" with { type: "json" };
|
import packageJson from "./package.json" with { type: "json" };
|
||||||
|
import cors from '@fastify/cors'
|
||||||
|
|
||||||
const fastify = Fastify({ logger: true });
|
const fastify = Fastify({ logger: true });
|
||||||
|
fastify.register(cors);
|
||||||
|
|
||||||
const client = new ApifyClient({
|
const client = new ApifyClient({
|
||||||
token: env.APIFY_TOKEN,
|
token: env.APIFY_TOKEN,
|
||||||
|
31
services/rssapp/package-lock.json
generated
31
services/rssapp/package-lock.json
generated
@ -1,15 +1,16 @@
|
|||||||
{
|
{
|
||||||
"name": "rssapp",
|
"name": "rssapp",
|
||||||
"version": "69.0.0",
|
"version": "69.0.1",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "rssapp",
|
"name": "rssapp",
|
||||||
"version": "69.0.0",
|
"version": "69.0.1",
|
||||||
"license": "Unlicense",
|
"license": "Unlicense",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@dotenvx/dotenvx": "^1.49.0",
|
"@dotenvx/dotenvx": "^1.49.0",
|
||||||
|
"@fastify/cors": "^11.1.0",
|
||||||
"@isaacs/ttlcache": "^1.4.1",
|
"@isaacs/ttlcache": "^1.4.1",
|
||||||
"apify-client": "^2.15.1",
|
"apify-client": "^2.15.1",
|
||||||
"fastify": "^5.5.0",
|
"fastify": "^5.5.0",
|
||||||
@ -114,6 +115,26 @@
|
|||||||
"fast-uri": "^3.0.0"
|
"fast-uri": "^3.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@fastify/cors": {
|
||||||
|
"version": "11.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@fastify/cors/-/cors-11.1.0.tgz",
|
||||||
|
"integrity": "sha512-sUw8ed8wP2SouWZTIbA7V2OQtMNpLj2W6qJOYhNdcmINTu6gsxVYXjQiM9mdi8UUDlcoDDJ/W2syPo1WB2QjYA==",
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/fastify"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/fastify"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"fastify-plugin": "^5.0.0",
|
||||||
|
"toad-cache": "^3.7.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@fastify/error": {
|
"node_modules/@fastify/error": {
|
||||||
"version": "4.2.0",
|
"version": "4.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/@fastify/error/-/error-4.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/@fastify/error/-/error-4.2.0.tgz",
|
||||||
@ -711,6 +732,12 @@
|
|||||||
"toad-cache": "^3.7.0"
|
"toad-cache": "^3.7.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/fastify-plugin": {
|
||||||
|
"version": "5.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/fastify-plugin/-/fastify-plugin-5.0.1.tgz",
|
||||||
|
"integrity": "sha512-HCxs+YnRaWzCl+cWRYFnHmeRFyR5GVnJTAaCJQiYzQSDwK9MgJdyAsuL3nh0EWRCYMgQ5MeziymvmAhUHYHDUQ==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/fastq": {
|
"node_modules/fastq": {
|
||||||
"version": "1.19.1",
|
"version": "1.19.1",
|
||||||
"resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.1.tgz",
|
"resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.1.tgz",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "rssapp",
|
"name": "rssapp",
|
||||||
"version": "69.0.1",
|
"version": "69.1.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
@ -12,6 +12,7 @@
|
|||||||
"license": "Unlicense",
|
"license": "Unlicense",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@dotenvx/dotenvx": "^1.49.0",
|
"@dotenvx/dotenvx": "^1.49.0",
|
||||||
|
"@fastify/cors": "^11.1.0",
|
||||||
"@isaacs/ttlcache": "^1.4.1",
|
"@isaacs/ttlcache": "^1.4.1",
|
||||||
"apify-client": "^2.15.1",
|
"apify-client": "^2.15.1",
|
||||||
"fastify": "^5.5.0",
|
"fastify": "^5.5.0",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user