Home > App Store > Create an application
If you create an application that you intend to publish on the App Store you must follow these guidelines, otherwise it may not run properly for all users.
1. All application files must be located in a folder (the application folder) and you must not reference files outside it. All files outside this folder are ignored when publishing the application.
Let's say that your application folder is "apps/myApp". When an user installs your application he can choose where to copy the application files (e.g. "otherApps/myApp"). If you have code that references absolute paths (e.g. require("apps/myApp/file") or fs.openRaw("apps/myApp/styles.css")) then the application won't work for the user.
That's why you must use relative paths to the current file (e.g. require("./file") or require("../file")). For getting the contents of "styles.css" file from the current module use this command: fs.openRaw( module.directory + "/styles.css"). The function module.directory gives you the absolute path of the directory that contains the current CommonJS module.
2. An application's entry point is a JSGI function that will be used for rendering the application. The JSGI function is not mandatory but we recommended it. In case your application is just a library you can have a JSGI function to show how to use the library functions, this way you make it easier for other users to understand and use it.
3. Each application must have a description file named: application.json that is located in the application's folder. Here is an example of such a file:
"name" : "Erbix Blog" ,
"mainModule" : "main.js" ,
"jsgiFunction" : "main",
"version": "0.1.0",
"description": "Blogging Application for the Erbix Platform.",
"keywords": ["erbix", "blog", "app" ],
"contributors": [
{
"name": "Mihai Roman",
"email": "mihai@erbix.com" ,
"web" : "http://mehi.erbix.com" ,
"username" : "mehi"
}
]
}
The file must have a valid JSON format. The following fields are mandatory: name, version, description. These fields describe the application attributes and will appear in the marketplace pages.
3.1. name: the name of the application. Must contain letters, numbers or spaces.
3.2. version: the application version.
3.3. description: the application description (what it does, features, ...).
There are additional fields that we recommend you to fill:
3.4. mainModule: the path to the main JSGI module. The path value must be relative to the application's root folder. E.g. "main.js" if the file is located in the root folder otherwise "path-to-folder/main.js" .
3.5. jsgiFunction: the name of the JSGI function found in the JSGI module.
3.6. contributors: information about the users that helped develop the application. Use the "username" key to specify the Erbix.com username.
Feel free to add other keys in the description file if you think that helps you to manage updates or gives more information about the application.
