add cors
This commit is contained in:
		
							parent
							
								
									4a185304ae
								
							
						
					
					
						commit
						0d53e49d89
					
				@ -1,16 +1,15 @@
 | 
			
		||||
// index.js
 | 
			
		||||
import Fastify from "fastify";
 | 
			
		||||
import fs from "fs";
 | 
			
		||||
import path from "path";
 | 
			
		||||
import RSS from "rss";
 | 
			
		||||
import TTLCache from '@isaacs/ttlcache';
 | 
			
		||||
import '@dotenvx/dotenvx/config.js';
 | 
			
		||||
import { ApifyClient } from 'apify-client';
 | 
			
		||||
import { env } from './env.js';
 | 
			
		||||
import packageJson from "./package.json" with { type: "json" };
 | 
			
		||||
import cors from '@fastify/cors'
 | 
			
		||||
 | 
			
		||||
const fastify = Fastify({ logger: true });
 | 
			
		||||
 | 
			
		||||
fastify.register(cors);
 | 
			
		||||
 | 
			
		||||
const client = new ApifyClient({
 | 
			
		||||
  token: env.APIFY_TOKEN,
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										31
									
								
								services/rssapp/package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										31
									
								
								services/rssapp/package-lock.json
									
									
									
										generated
									
									
									
								
							@ -1,15 +1,16 @@
 | 
			
		||||
{
 | 
			
		||||
  "name": "rssapp",
 | 
			
		||||
  "version": "69.0.0",
 | 
			
		||||
  "version": "69.0.1",
 | 
			
		||||
  "lockfileVersion": 3,
 | 
			
		||||
  "requires": true,
 | 
			
		||||
  "packages": {
 | 
			
		||||
    "": {
 | 
			
		||||
      "name": "rssapp",
 | 
			
		||||
      "version": "69.0.0",
 | 
			
		||||
      "version": "69.0.1",
 | 
			
		||||
      "license": "Unlicense",
 | 
			
		||||
      "dependencies": {
 | 
			
		||||
        "@dotenvx/dotenvx": "^1.49.0",
 | 
			
		||||
        "@fastify/cors": "^11.1.0",
 | 
			
		||||
        "@isaacs/ttlcache": "^1.4.1",
 | 
			
		||||
        "apify-client": "^2.15.1",
 | 
			
		||||
        "fastify": "^5.5.0",
 | 
			
		||||
@ -114,6 +115,26 @@
 | 
			
		||||
        "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": {
 | 
			
		||||
      "version": "4.2.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@fastify/error/-/error-4.2.0.tgz",
 | 
			
		||||
@ -711,6 +732,12 @@
 | 
			
		||||
        "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": {
 | 
			
		||||
      "version": "1.19.1",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.1.tgz",
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
{
 | 
			
		||||
  "name": "rssapp",
 | 
			
		||||
  "version": "69.0.1",
 | 
			
		||||
  "version": "69.1.0",
 | 
			
		||||
  "description": "",
 | 
			
		||||
  "main": "index.js",
 | 
			
		||||
  "type": "module",
 | 
			
		||||
@ -12,6 +12,7 @@
 | 
			
		||||
  "license": "Unlicense",
 | 
			
		||||
  "dependencies": {
 | 
			
		||||
    "@dotenvx/dotenvx": "^1.49.0",
 | 
			
		||||
    "@fastify/cors": "^11.1.0",
 | 
			
		||||
    "@isaacs/ttlcache": "^1.4.1",
 | 
			
		||||
    "apify-client": "^2.15.1",
 | 
			
		||||
    "fastify": "^5.5.0",
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user