Coder Social home page Coder Social logo

cdn-integration-prototype's Introduction

CDN Integration Prototype with Kong and Python

Introduction

This README provides an overview of the CDN integration prototype using Kong and Python. The objective of this prototype is to demonstrate CDN functionality without implementing caching for a web application. This demonstration uses a simulated setup for educational and demonstration purposes.

Prerequisites

  • Kong: Ensure that Kong is installed on your local machine or server.
  • Python: Make sure you have Python installed, along with the requests library ( pip install requests).
  • A web application URL (for simulation).

Installation and Setup

  1. Kong Installation:

    • Install Kong on your local machine following the installation guide for your platform here I'm using ubuntu linux system: Kong Installation Guide.
  2. Kong Startup:

    • Start the Kong API Gateway service:
      kong start

Configuration in Kong

  1. Access Kong Admin API:

    • Open your web browser and access Kong's Admin API interface, typically located at http://localhost:8001. This is where you'll configure Kong.
  2. Create a Dummy Service:

    • Create a dummy service to represent your web application. Replace http://example.com with your actual web application URL:
      curl -i -X POST --url http://localhost:8001/services/ --data 'name=dummy-service' --data 'url=http://example.com'
  3. Create a Route for the Dummy Service:

    • Create a route for the "dummy-service" to specify how incoming requests should be handled:
      curl -i -X POST --url http://localhost:8001/services/dummy-service/routes --data 'paths[]=/my-route'

Simulate Asset Upload and Retrieval

  1. Python Functions:

    • Implement Python functions for simulating asset upload and retrieval using the provided code. Replace placeholder URLs and paths with your actual configurations. The code includes the following functions:
      • upload_asset(file_path): Simulate asset upload.
      • retrieve_asset(asset_filename): Simulate asset retrieval.
  2. Test the Python Functions:

    • Test the Python functions to ensure they work as expected. You can use the example provided in the code.

Documentation

  • The assets/ directory is used for simulating asset storage. You can replace this with the actual asset storage mechanism in a real-world scenario.

  • Additional documentation and configuration details can be added to further explain the setup and usage.

Disclaimer

This prototype is for educational and demonstration purposes. In a production environment, actual CDN services and configurations would be used.

Author

Ilma Salsabil

cdn-integration-prototype's People

Contributors

crocmons avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.