Skip to content

Latest commit

 

History

History
50 lines (37 loc) · 1.54 KB

README.md

File metadata and controls

50 lines (37 loc) · 1.54 KB

NodeCDN

A simple library that transforms JavaScript into a better platform.

Installation

  • For client sides: <script class="nodecdn-init" src="https://hostereric.herokuapp.com/NodeCDN/index.min.js"></script>
  • For backend: Go down to the backend section.

Initialising on the backend

  • Python (Flask): pip install nodecdn or use your Package Manager to search for nodecdn.

For standalone installs:

  1. Download the latest ZIP file from Releases
  2. UnZIP, then move to your website's asset directory
  3. Initialise it like in this example here (change the src to your corresponding path): <script class="nodecdn-init standalone" src="assets/NodeCDN/init/index.min.js"></script>

Start coding

  • To initialise in JavaScript, copy and paste this code into your script file:
nd = new Node(); //initialise the NodeCDN minimal js script
nd.Client('key'); //initialise the client

Init();
  • To initalise in Python, copy and paste this code into your script files:
# This is the file where your Flask server will be

from flask import Flask
from nodecdn import backend, frontend

app = Flask('app')

@app.route('/')
def index(): return "home"

backend.init(app);
app.run()
<!--Put before closing body tag -->
<script src="nodecdn/dist"></script>
<script>

</script>

After you have done this, you can read our docs here: https://nodecdndocs.readthedocs.io