From a21c92a3630ab6eca744e043acba908dfccc32a2 Mon Sep 17 00:00:00 2001 From: treeoflife2 Date: Mon, 11 Aug 2025 23:52:16 +0530 Subject: [PATCH 1/2] rename file and update text for llms.txt --- defillama-openapi-free.json | 2 +- defillama-openapi-pro.json | 2 +- examples/web/vite.config.ts | 25 ++++++++++++++++++++++++- defillama-llms.txt => llms.txt | 0 4 files changed, 26 insertions(+), 3 deletions(-) rename defillama-llms.txt => llms.txt (100%) diff --git a/defillama-openapi-free.json b/defillama-openapi-free.json index 625e7a2891c..8f4e3f0beb4 100644 --- a/defillama-openapi-free.json +++ b/defillama-openapi-free.json @@ -1,7 +1,7 @@ { "openapi": "3.0.0", "info": { - "description": "\n\nNeed higher rate limits or priority support? We offer a premium plan for 300$/mo. To get it, go to https://defillama.com/subscription\n \n\n download the standard llms.txt file(guide for AI models)", + "description": "\n\nNeed higher rate limits or priority support? We offer a premium plan for 300$/mo. To get it, go to https://defillama.com/subscription \n\n\n Coding with AI? Paste this link to LLM-specific docs for best results \nllms.txt", "version": "1.0.0-oas3", "title": "DefiLlama API" }, diff --git a/defillama-openapi-pro.json b/defillama-openapi-pro.json index 0958e3cdf26..48e3b76661d 100644 --- a/defillama-openapi-pro.json +++ b/defillama-openapi-pro.json @@ -3,7 +3,7 @@ "info": { "title": "DefiLlama Pro - OpenAPI 3.0", "version": "1.0.0", - "description": "Docs for DefiLlama's Pro API \n\n download the standard llms.txt file(guide for AI models)" + "description": "Docs for DefiLlama's Pro API \n\n\n Coding with AI? Paste this link to LLM-specific docs for best results \nllms.txt" }, "servers": [ { diff --git a/examples/web/vite.config.ts b/examples/web/vite.config.ts index 96766d3d785..35bff5daa87 100644 --- a/examples/web/vite.config.ts +++ b/examples/web/vite.config.ts @@ -1,9 +1,32 @@ import vue from '@vitejs/plugin-vue' import { defineConfig } from 'vite' +import path from 'path' +import fs from 'fs' // https://vitejs.dev/config/ export default defineConfig({ - plugins: [vue()], + plugins: [ + vue(), + { + name: 'serve-llms-txt', + configureServer(server) { + server.middlewares.use((req, res, next) => { + if (req.url === '/llms.txt') { + const filePath = path.resolve(__dirname, '../../llms.txt') + if (fs.existsSync(filePath)) { + res.setHeader('Content-Type', 'text/plain') + fs.createReadStream(filePath).pipe(res) + } else { + res.statusCode = 404 + res.end('Not Found') + } + } else { + next() + } + }) + }, + }, + ], server: { port: 5050, open: true, diff --git a/defillama-llms.txt b/llms.txt similarity index 100% rename from defillama-llms.txt rename to llms.txt From 8140ebce6f5ff2fb8dffb698c0896f3036fa4c5b Mon Sep 17 00:00:00 2001 From: 0xngmi <80541789+0xngmi@users.noreply.github.com> Date: Mon, 11 Aug 2025 20:08:39 +0100 Subject: [PATCH 2/2] revert server change --- examples/web/vite.config.ts | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/examples/web/vite.config.ts b/examples/web/vite.config.ts index 35bff5daa87..46aaa190b3f 100644 --- a/examples/web/vite.config.ts +++ b/examples/web/vite.config.ts @@ -5,28 +5,7 @@ import fs from 'fs' // https://vitejs.dev/config/ export default defineConfig({ - plugins: [ - vue(), - { - name: 'serve-llms-txt', - configureServer(server) { - server.middlewares.use((req, res, next) => { - if (req.url === '/llms.txt') { - const filePath = path.resolve(__dirname, '../../llms.txt') - if (fs.existsSync(filePath)) { - res.setHeader('Content-Type', 'text/plain') - fs.createReadStream(filePath).pipe(res) - } else { - res.statusCode = 404 - res.end('Not Found') - } - } else { - next() - } - }) - }, - }, - ], + plugins: [vue()], server: { port: 5050, open: true,