Closed sateffen closed 10 years ago
The JSON will look like:
{
basepath: 'path/where/everything/is'
routes: [
{
route: '/route/:id?',
controller: 'path/to/controller'
caseSensetive: false
}
],
services: [
{
id: 'id',
type: 'type',
controller: 'path/to/controller'
}
],
preprocessors: [
'/path/to/preprocessor'
],
postprocessors: [
],
loadpaths: [
'path1'
],
http: {
port: 80
},
https: {
port: 443,
cert: 'cert',
key: 'key',
options: {}
}
}
Even though this is a javascript object, image it's valid JSON
I added a test for the global nodgine functions, so for this feature, too. The tests are going well, so the feature itself can be used, but needs some documentation in the wiki. If the unittest is finished as well, I'll close this feature-ticket, and release the next version of the nodgine.
I guess this feature is now implemented. Every test I've done worked. If you find a bug, send me an issue report
Maybe there should be an possibility configure the whole process via a json file. Currently the main javascript file is simply a file, that calls hundred times addRoute, hundred times registerService, finally startHTTP and then run. This gets pretty unreadable. A json file would be better.