1 |
|
2 | # Igo.js Introduction
|
3 |
|
4 | Igo.js is a full-featured Node.js web framework for developing web applications.
|
5 |
|
6 | Igo is not a boilerplate to help you start with Node.js. It embeds and leverages on the most used frameworks and libraries in the Node.js ecosystem.
|
7 |
|
8 | In a few seconds it can give you a production-ready application and a 100% working development environment.
|
9 |
|
10 | We love Node.js, it's a fantastic and easy technology to build and run web applications.
|
11 | But after building several projects, we found that it was a pain to duplicate these many *technical* files:
|
12 | - `app.js` for Express and its bunch of middlewares, plus the configuration for these middlewares,
|
13 | - `Gulpfile.js` or `webpack.config.js` to setup a nice development environment,
|
14 | - MySQL, Redis, SMTP configurations and connections,
|
15 | - `package.json` with so many dependencies,
|
16 | - `Mocha` configuration and tools to write good tests,
|
17 | - ...etc.
|
18 |
|
19 | After several months spent duplicating the same configuration and the same technical stack over and over, well, it appeared clearly that all this had very little added value. That's how Igo.js was born.
|
20 |
|
21 | ## Installation
|
22 | ```sh
|
23 | # install mocha
|
24 | npm install -g mocha
|
25 |
|
26 | # install igo
|
27 | npm install -g igo
|
28 | ```
|
29 |
|
30 | ## Getting started
|
31 | ```sh
|
32 | # create new project
|
33 | igo create myproject
|
34 | cd myproject
|
35 |
|
36 | # install node.js dependencies
|
37 | npm install
|
38 |
|
39 | # start the server on http://localhost:3000
|
40 | npm start
|
41 | ```
|
42 |
|
43 | ## Configuration
|
44 | The Igo configuration is located in `/app/config.js`.
|
45 | The configuration is initialized at startup, and can be retrieved through igo module:
|
46 | ```js
|
47 | var config = require('igo').config`;
|
48 | ```
|
49 |
|
50 | Some configuration parameters can be defined with environment variables. Igo uses [dotenv](https://github.com/motdotla/dotenv), so you can just add/override variables in the `/.env` file.
|
51 | E.g:
|
52 | ```txt
|
53 | # development database
|
54 | MYSQL_DATABASE=mydatabase
|
55 | ```
|