zh Kooboo Logo Documents

API & Server Side Script

 

Under the "Code" menu in the development menu, you can create APIs or JS modules. These codes run on the backend.
 
 
To create APIs more quickly, you can utilize the methods available under the k.api namespace. For more information, please refer to the documentation on KScript.
 
If you want to run server-side scripts on a webpage, you need to use the env=server tag.
 
<script env="server">
    var text = "Hello World"; 
</script> 
<div>
    <h2 k-content="text">text</h2> 
</div>
 
The code inside the <script> tag mentioned above will indeed run on the server-side.