This repository has been archived by the owner on Jul 12, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
76 changed files
with
6,760 additions
and
10,855 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,3 +1,4 @@ | ||
node_modules/* | ||
test/artifacts/* | ||
.env | ||
.eslintrc.js |
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,16 +1,6 @@ | ||
sudo: true | ||
language: node_js | ||
node_js: | ||
- "8" | ||
- "9" | ||
services: | ||
- mongodb | ||
env: | ||
- NODE_ENV=test CXX=g++-4.8 | ||
before_install: | ||
- sudo apt-get install unicode-data | ||
addons: | ||
apt: | ||
sources: | ||
- ubuntu-toolchain-r-test | ||
packages: | ||
- g++-4.8 |
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 |
---|---|---|
|
@@ -35,7 +35,6 @@ this repo and build one on top of Frame. | |
| url | username | password | | ||
|:-------------------------------------------------------------------------- |:-------- |:-------- | | ||
| [https://getframe.herokuapp.com/](https://getframe.herokuapp.com/) | root | root | | ||
| [https://getframe.herokuapp.com/docs](https://getframe.herokuapp.com/docs) | ---- | ---- | | ||
|
||
[Postman](http://www.getpostman.com/) is a great tool for testing and | ||
developing APIs. See the wiki for details on [how to | ||
|
@@ -44,19 +43,14 @@ login](https://github.com/jedireza/frame/wiki/How-to-login). | |
|
||
## Requirements | ||
|
||
You need [Node.js](http://nodejs.org/download/) installed and you'll need | ||
[MongoDB](http://www.mongodb.org/downloads) installed and running. | ||
|
||
We use [`bcrypt`](https://github.com/ncb000gt/node.bcrypt.js) for hashing | ||
secrets. If you have issues during installation related to `bcrypt` then [refer | ||
to this wiki | ||
page](https://github.com/jedireza/frame/wiki/bcrypt-Installation-Trouble). | ||
You need [Node.js](http://nodejs.org/download/) `>=8.x` and you'll need a | ||
[MongoDB](http://www.mongodb.org/downloads) `>=2.6` server running. | ||
|
||
|
||
## Installation | ||
|
||
```bash | ||
$ git clone git@github.com:jedireza/frame.git | ||
$ git clone https://github.com/jedireza/frame.git | ||
$ cd frame | ||
$ npm install | ||
``` | ||
|
@@ -101,7 +95,7 @@ $ npm run first-time-setup | |
```bash | ||
$ npm start | ||
|
||
# > [email protected] start /Users/jedireza/projects/frame | ||
# > [email protected] start /home/jedireza/projects/frame | ||
# > ./node_modules/nodemon/bin/nodemon.js -e js,md server | ||
|
||
# 09 Sep 03:47:15 - [nodemon] v1.10.2 | ||
|
@@ -114,11 +108,28 @@ see the welcome message. | |
[`nodemon`](https://github.com/remy/nodemon) watches for changes in server | ||
code and restarts the app automatically. | ||
|
||
We also pass the `--inspect` flag to Node so you have a debugger available. | ||
Watch the output of `$ npm start` and look for the debugging URL and open it in | ||
Chrome. It looks something like this: | ||
### With the debugger | ||
|
||
`chrome-devtools://devtools/remote/serve_file/@62cd277117e6f8ec53e31b1be58290a6f7ab42ef/inspector.html?experiments=true&v8only=true&ws=localhost:9229/node` | ||
```bash | ||
$ npm run inspect | ||
|
||
# > [email protected] inspect /home/jedireza/projects/frame | ||
# > nodemon --inspect -e js,md server.js | ||
|
||
# [nodemon] 1.14.12 | ||
# [nodemon] to restart at any time, enter `rs` | ||
# [nodemon] watching: *.* | ||
# [nodemon] starting `node --inspect server.js` | ||
# Debugger listening on ws://127.0.0.1:9229/3d706d9a-b3e0-4fc6-b64e-e7968b7f94d0 | ||
# For help see https://nodejs.org/en/docs/inspector | ||
# 180203/193534.071, [log,info,mongodb] data: HapiMongoModels: successfully connected to the db. | ||
# 180203/193534.127, [log,info,mongodb] data: HapiMongoModels: finished processing auto indexes. | ||
# Server started on port 9000 | ||
``` | ||
|
||
Once started with the debuger you can open Google Chrome and go to | ||
[chrome://inspect](chrome://inspect). See https://nodejs.org/en/docs/inspector/ | ||
for more details. | ||
|
||
|
||
## Running in production | ||
|
@@ -157,23 +168,32 @@ use to write all of our tests. | |
```bash | ||
$ npm test | ||
|
||
# > [email protected] test /Users/jedireza/projects/frame | ||
# > ./node_modules/lab/bin/lab -c | ||
# > [email protected] test /home/jedireza/projects/frame | ||
# > lab -c -L | ||
|
||
# .................................................. | ||
# .................................................. | ||
# .................................................. | ||
# .................................................. | ||
# .................................................. | ||
# ........ | ||
# .................................................. | ||
# .................................................. | ||
# .................................................. | ||
# .............. | ||
|
||
# 258 tests complete | ||
# Test duration: 2398 ms | ||
# 164 tests complete | ||
# Test duration: 14028 ms | ||
# No global variable leaks detected | ||
# Coverage: 100.00% | ||
# Linting results: No issues | ||
``` | ||
|
||
### Targeted tests | ||
|
||
If you'd like to run a specific test or subset of tests you can use the | ||
`test-server` npm script. | ||
|
||
You specificy the path(s) via the `TEST_TARGET` environment variable like: | ||
|
||
```bash | ||
$ TEST_TARGET=test/server/web/main.js npm run test-server | ||
``` | ||
|
||
## License | ||
|
||
MIT | ||
|
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
Oops, something went wrong.