Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bhou/fx-wavelet-core
https://github.com/bhou/fx-wavelet-core
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/bhou/fx-wavelet-core
- Owner: bhou
- Created: 2015-06-22T15:01:09.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-06-22T15:20:30.000Z (over 9 years ago)
- Last Synced: 2024-04-15T00:16:51.399Z (9 months ago)
- Language: JavaScript
- Size: 121 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Wavelet
Internal name: fx-wavelet
A new way to develop your backend application.
## Installation
``````` sh
npm install -g wavelet
```````## Usage
````` sh
Usage: wavelet [action] [options]
Action:start [app] [options] start an application
App: application path, by default: current working directory
Options:
--config: the wavelet configuration file, by default {your app}/app.js
--root: the web app root
--port: the web app port
--disableEditor: disable the application editor
Plugin Options:create [project] create a wavelet project
install [plugin/wavelet] [version] install plugin or wavelet
install pack [plugin/wavelet pack] install plugin or wavelet package
plugin/wavelet pack could be a name or a pack file path
Example: wavelet install pack core
Example: wavelet install pack .pack.jsonget repo get repository location
set repo [location] set repository location
Runtime options:
-c fx-runtime config file, could be any nodejs requirable file (json, js etc. By defaut: ./config.js)
-d debug, toggle debug
-h help
`````## global variable registered
**Wavelet** inherits the gloabl variables defined in fx-runtime. Besides, it registers the following global variables:#### root
the web app root. You need to register all your route in your plugin start with this rootFor example
``````javascript
webapp.use(root + '/register', function(req, res) {
});webapp.post(root + '/login', function(req, res) {
});
``````
It could be configured in config file or through command line argument --root## Format of config file
Wavelet config file could be a json or a js file, or any nodejs requirable files.
Config file must return a json object with following fields:- apps: [optional] the list of application plugin
- home: the home path of your application
- root: the root web path, default ''
- binding: [optional] service implementation binding
- pluginSearchPaths: a list of paths to locate your plugins
- defaultPluginConfig: default plugin configs. [JSON object] key is the plugin name, value is the config object
- whiteList: [optional] the white list of plugin
- blackList: [optional] the black list of pluginExample:
````` javascript
module.exports = {
"home": __dirname,
"pluginSearchPaths": [
__dirname + '/plugins',
__dirname + '/../../fx-plugins'
],
"defaultPluginConfig": {
"fx-mongodb": {}
}
};
`````