README.md in nephos-server-0.6.3 vs README.md in nephos-server-0.6.4
- old
+ new
@@ -17,11 +17,10 @@
- [Slim](DOCUMENTATION/TEMPLATING/SLIM.md)
- Database orm and connector: It already exists and simple to implement too.
- [Sequel](DOCUMENTATION/DATABASE/SEQUEL.md)
# Start
-
```sh
gem install nephos # download the server and executables
ngenerator application MyApp # generate the application
cd MyApp # go in
nserver -p 8080 -h 0.0.0.0 # start the server. port is not required, neither host
@@ -37,11 +36,10 @@
# Documentation
## Guides
-
Theses guides will provide you knowlegde about everything you can use in the application.
- [Generator GUIDE](DOCUMENTATION/GUIDE_GENERATOR.md)
- [Render API](DOCUMENTATION/API_RENDER.md)
- [Router GUIDE](DOCUMENTATION/GUIDE_ROUTER.md)
@@ -49,20 +47,20 @@
- [Customisable errors GUIDE](DOCUMENTATION/GUIDE_ERRORS.md)
- [Code documentation on RubyDoc.info](http://www.rubydoc.info/gems/nephos-server/toplevel) -> **Note: you can also generate local documentation via yard**
## Examples
-### Production
+### Production and environment
+To avoid information leaks from your application, set the environment variable
+``export ENVIRONMENT=production``, or run the server with ``-e production``
+parameter. When an error occurs, the backtrace will be print to the client in
+the rendered page, unless the server runs in production environment.
-To avoid information leaks from your application, set the environment variable ``export ENVIRONMENT=production``,
-or run the server with ``-e production`` parameter.
-It will disable ruby error messages when an error occurs in the controller.
-
### Controller
-
+Every routes will call a method from a controller.
To create a controller, add a ruby file to ``app/``, with a class inherited by ``Nephos::Controller``
-The basic code of a controller can be generated via ``ngenerator controller NAME``.
+You should user ``ngenerator --controller NAME`` to generate a new controller.
```ruby
class Example < Nephos::Controller
def root
cookies["last_visit"] = Time.now
@@ -74,11 +72,10 @@
end
end
```
### Rendering
-
To render a content to the client, you can return informations from a Controller method:
```ruby
return 404
return {status: code}
@@ -89,11 +86,10 @@
return {type: "image/jpeg", content: File.read("images/photo.jpg")}
return :empty
```
### Routing
-
The routing (rules to execute the action the user wants), you have to write the ``/routes.rb`` file.
If the user try to access an url not described in the file, it will automaticaly render a 404 not found.
```ruby
get url: "/", controller: "MainController", method: "root" # /
@@ -109,16 +105,17 @@
# Developers: Roadmap
## TODO v0.6
-- feature to change HTTP header from controller
+- Alias for routing
- functionnal tests
+- extension for urls (optional .xxx, with controller effect)
## TODO v0.7
+- feature to change HTTP header from controller
- Documentation on architecture (UML)
- Improved documentation (Tutorial, Improved guides)
-- Alias for routing
## v1 requierements
- Environement, Daemons, Port, Listen Host, Routables, Arguments
- Clear architecture
- Generator readables and powerfull