emmanuel-keller / qwazr-javascript-example

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

QWAZR Javascript example

This is an instance of a website structure for QWAZR

A typical website structure contains the following directories:

  • controllers: The controllers written in Javascript,
  • model: The classes managing your data (MongoDB in this case),
  • views: The template files (freemarker in this case),
  • static: Contains the static files (css, javascript).

The default controller is called home.js located in the root of the controller directory.

The following files defines the application:

  • connectors.json: Defines connectors (like database connection pools) available in the controller,
  • tools.json: Defines singleton objects available in the controllers,
  • [webapps/ROOT.json][webapps/ROOT.json]: Defines the mapping between URLs and controllers and static files.

Deploy in minutes

1. Be sure you have JAVA 8 installed:

2. A MongoDB instance is required

This tutorial will connect to an existing local MongoDB server. You can change the connections parameters in the file connectors.json. The tutorial will create a database called "qwazr_js_example" and fill a collection called "entries".

If you need to install MongoDB, here is the installation documentation.

3. Clone this repository:

If you use GIT you can use the usual git command:

git clone https://github.com/qwazr/qwazr-javascript-example.git

You may also download the zipped version.

4. Get the latest QWAZR executable jar:

Download the executable jar library and put it in the root of the repository.

The latest nightly build is here: download.qwazr.com

The name of the file is: qwazr-server-1.0.0-SNAPSHOT-exec.jar

5. Start the server

Move to your repository and start the server:

java -Dfile.encoding=UTF-8 qwazr-server-1.0.0-SNAPSHOT-exec.jar

6. Welcome to QWAZR !

You can now see your application running:

http://localhost:9090

About


Languages

Language:FreeMarker 51.7%Language:JavaScript 48.1%Language:CSS 0.3%