-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: use stable versions of test modules
- Loading branch information
Showing
2 changed files
with
91 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,16 @@ | ||
<img src="http://52.209.207.148/assets/products/dadi-web-full.png" alt="DADI Web" height="65"/> | ||
<img src="https://dadi.tech/assets/products/dadi-web.png" alt="DADI Web" height="65"/> | ||
|
||
[](https://www.npmjs.com/package/@dadi/web) | ||
[](https://github.com/dadi/web) | ||
[](https://github.com/dadi/web) | ||
[](https://travis-ci.org/dadi/web) | ||
[](http://standardjs.com/) | ||
[](https://github.com/semantic-release/semantic-release) | ||
|
||
## DADI Web | ||
|
||
* [Overview](#overview) | ||
* [Requirements](#requirements) | ||
* [Getting started](#getting-started) | ||
* [Links](#links) | ||
|
||
## Overview | ||
|
||
|
@@ -16,39 +22,102 @@ DADI Web uses LinkedIn's Dust templating language which provides a simple yet po | |
|
||
DADI Web is part of [DADI](https://github.com/dadi/), a suite of components covering the full development stack, built for performance and scale. | ||
|
||
## Getting Started | ||
## Requirements | ||
|
||
* Node.js versions: | ||
* 4.7.0 | ||
* 5.12.0 | ||
* 6.9.2 | ||
|
||
## Getting started | ||
|
||
### Initialise the project | ||
|
||
Running `npm init` adds a file called `package.json` to your project, allowing you to easily add dependencies to it: | ||
|
||
```bash | ||
$ npm init | ||
``` | ||
|
||
### Install the module from NPM | ||
|
||
All DADI platform microservices are available from [NPM](https://www.npmjs.com/). To add *Web* to your project as a dependency: | ||
|
||
```bash | ||
$ npm install --save @dadi/web | ||
``` | ||
|
||
### Add an entry point | ||
|
||
You'll need an entry point for your project. We'll create a file called `index.js` and later we will start the application with `node index.js`. | ||
|
||
### Install via NPM | ||
Add the following to the new file: | ||
|
||
```shell | ||
npm install @dadi/web | ||
```js | ||
/** | ||
* index.js | ||
*/ | ||
var app = require('@dadi/web') | ||
``` | ||
|
||
### Install via DADI Generator | ||
### Configuration | ||
|
||
Web requires a configuration file specific to the application environment. For example in the production environment it will look for a file named `config.production.json`. | ||
|
||
Place configuration files in a `config` folder in your application root, for example `config/config.development.json`. Full configuration documentation can be found at http://docs.dadi.tech/web/getting-started/configuration/. | ||
|
||
**Sample configuration** | ||
|
||
```json | ||
{ | ||
"server": { | ||
"host": "localhost", | ||
"port": 3000 | ||
}, | ||
"api": { | ||
"host": "localhost", | ||
"port": 3001 | ||
} | ||
} | ||
``` | ||
|
||
### Start the server | ||
|
||
Web can be started from the command line simply by issuing the following command: | ||
|
||
```bash | ||
node index.js | ||
``` | ||
npm install -g @dadi/generator | ||
dadi-generator web /path/to/your_new_app | ||
cd /path/to/your_new_app | ||
npm install | ||
npm start | ||
|
||
With the configuration above, our Web server is available at http://localhost:3000. | ||
|
||
#### Run Web as a service | ||
|
||
To run your Web application in the background as a service, install Forever and Forever Service: | ||
|
||
```bash | ||
$ npm install forever forever-service -g | ||
|
||
$ forever-service install -s index.js -e NODE_ENV=production web --start | ||
``` | ||
|
||
## Documentation | ||
> Note: the environment variable `NODE_ENV=production` must be set to required the configuration version matching the configuration files available in the `config` directory. | ||
|
||
Documentation can be found at the [DADI Docs site](http://docs.dadi.tech/web/). | ||
## Links | ||
* [Web Documentation](http://docs.dadi.tech/web/) | ||
|
||
## Licence | ||
|
||
DADI is a data centric development and delivery stack, built specifically in support of the principles of API first and COPE. | ||
|
||
Copyright notice | ||
(C) 2016 DADI+ Limited <[email protected]> | ||
Copyright notice<br /> | ||
(C) 2017 DADI+ Limited <[email protected]><br /> | ||
All rights reserved | ||
|
||
This product is part of DADI.<br /> | ||
DADI is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License as published by | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version ("the GPL"). | ||
|
||
|
@@ -64,12 +133,11 @@ them, to determine what licences are applicable.** | |
DADI is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU Affero General Public License for more details. | ||
GNU General Public License for more details. | ||
|
||
The GNU Affero General Public License (GPL) is available at | ||
The GNU General Public License (GPL) is available at | ||
http://www.gnu.org/licenses/gpl-3.0.en.html.<br /> | ||
A copy can be found in the file GPL.md distributed with | ||
these files. | ||
|
||
This copyright notice MUST APPEAR in all copies of the product! | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters