{"repo":"cdnjs/api-server","free":true,"listed":false,"github":"https://github.com/cdnjs/api-server","clone":"git clone https://github.com/cdnjs/api-server.git","description":"📡 API server for api.cdnjs.com - The #1 free and open source CDN built to make life easier for developers.","language":"TypeScript","stars":112,"topics":["cdnjs","cdnjs-api","cdn","api","api-server","hacktoberfest","cloudflare-worker","cloudflare-workers","javascript","wrangler-cli"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"\" The #1 free and open source CDN built to make life easier for developers. --- cdnjs API Server Looking for the documentation on our API? cdnjs API docs Getting Started This project uses Node.js for development, and is deployed as a Cloudflare Worker. Please make sure you have a Node.js version installed that matches our defined requirement in the .nvmrc file for this project. Included with this project is a dependency lock file. This is used to ensure that all installations of the project are using the same version of dependencies for consistency. You can install the dependencies following this lock file by running: Once the dependencies are installed, which includes the Wrangler CLI for Cloudflare Workers, the API server is now ready to run in development mode. To start the server in development mode, run: This command will run the worker entirely locally, and you can access the API at http://localhost:8787 (note that the root path redirects to the docs). Website React Output The same API server worker also powers the cdnjs.com website, returning rendered React responses. This done by setting the WEBSITE BASE Worker environment variable, which will cause the API server to return HTML instead of JSON when a request has a matching base URL. While the worker cannot be served from multiple base URLs in development mode, you can run the worker with the WEBSITE BASE environment variable set to http://localhost:8787 to test locally: When building pages for the website output, cli","default_branch":null,"files":null,"tree":[],"storefront":"/r/cdnjs","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/cdnjs/api-server/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}