# Example003
This is an example project about how to use Ocean ( as framework. First of all, you have to setup your Go compiler ( and the environment e.g. setup the workspace, etc. (

Next, you should install Git e.g. on Microsoft Windows use With Git, you are convenient to get any Go library and framework from e.g. GitHub (, where Ocean waits for you. After Git is installed, run this command on a command line: `go get -u`. This installs the Ocean framework for you. To get also this example project, run: `go get -u`.

You are now ready to compile this Ocean example. Go to the project's directory e.g. on Microsoft Windows `c:\Golang\src\\SommerEngineering\Example003` and execute the command `go install`. The executable is then installed e.g. in `c:\Golang\bin`. You have to prepare the environment e.g. setup a MongoDB server ( and the project's configuration (see for details).

After everything is fine, you are able to start your server by executing the executable. You will see the console logging and your handlers are available. The admin handlers are bind to localhost: and You can access the admin's interface by The public handlers are bind to your current IP address.

In order to run the example with the questions and answers (shows you how to use e.g. the template engine, the customer database access and I18N), you have to upload the HTML templates. Therefore, you must create an archive `` where you store all your templates. In case of this example, you store the `Question.html` and `Answers.html` files from ``. Afterwards, use the admin's interface of the running server ( to upload the archive into the distributed grid file system of the database. Finnaly, you have to restart the server to load the template. Then, you are able to access the example on the path `/question` on the public web server.

The questions and answers example works like this: First, you utilise `/question` handler i.e. path to get the question. Read the handler code to see how to use the template and I18N engine. If you submit your answer, the answer will be send to `/store`. The store handler will try to store the answer to the customer database. Afterwards, the store handler redirects the client i.e. browser to `/answers`. The answers handler will show all stored answers.

Imports 7 package(s) ΒΆ