Documentation
Main configuration
Main configuration file is anjy_config.json.
|
Folder for public files such as index.html, style.css, script.js, etc. |
||||||||||||
|
Folder for private session files. Those files are similar to PHP session files. In ANJY session files also not encoded so you should specify a private directory for them |
||||||||||||
|
Folder for your routes. We also recommend you to hide this folder from public access |
||||||||||||
|
The port that will be used for the server. By default, the port is 8080 but you can use port 80. |
||||||||||||
|
Name for a session that you can see in the browser's cookie. For example: in PHP you can see name PHPSESSID |
||||||||||||
|
Time in seconds. When the time is up session file will be destroyed |
||||||||||||
|
Password for system functions that can be executed from the browser. For example http://127.0.0.1:8080/anjy_reload?secret=my_secret |
||||||||||||
|
The file returned with a 404 response. Remember! The file must be in |
||||||||||||
|
|
Routes
The route is a file with instructions for each request for ANJY. Routes must be placed in RoutePath. It also has a JSON structure.
|
REQUEST_URI string. For example: |
|
|
Request method that works on this url |
[method name] >
|
true | false |
[method name] >
|
"read" | "write". Instructions for a database. If you are using SELECT - type "read". For other methods such as INSERT | UPDATE ... use "write" |
[method name] >
|
SQL request string. For variables use ":" before the variable name. For example |
[method name] >
|
Array of input data fields. For example if you have |
|
|
Array of conditions to perform operation in this request. |
|
variable name in Session |
|
|
|
value that will be compared |
|
Object for result action |
|
"json" | "html" |
|
"RESULT_FIRST_ROW" Or you can skip this property. |
|
|
|
A string for template that will be rendered if |
HTML templates
Template for rendering result from database is very simple. There is only one directive to render array of data. It is tag [repeat]. Inside this tag you can show items accessed by their names. For example
Remember! You can use only one declaration in template file of [repeat] section.