Skip to content

Commit

Permalink
chore: change default port to 62893
Browse files Browse the repository at this point in the history
  • Loading branch information
shadowgate15 committed Jun 5, 2022
1 parent 22abb37 commit 11bb7de
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
[![made with lad](https://img.shields.io/badge/made_with-lad-95CC28.svg)](https://lad.js.org)

> An API for Bree.
> An API for [Bree][].
## Table of Contents

Expand Down Expand Up @@ -41,7 +41,7 @@ The API will start automatically when the Bree constructor is called.

| Option | Type | Description |
|:------:|:------:|----------------------------------------------------------------------------------------------|
| port | Number | The port the API will listen on. |
| port | Number | The port the API will listen on. Default: `62893` |
| jwt | Object | Configurations for JWT. Only option is `secret` which will be the secret used to verify JWT. |

## API
Expand All @@ -56,3 +56,9 @@ Check out the [API Docs](https://documenter.getpostman.com/view/17142435/TzzDLbN
[MIT](LICENSE) © [Nick Baugh](http://niftylettuce.com/)

##

[npm]: https://www.npmjs.com/

[yarn]: https://yarnpkg.com/

[Bree]: https://jobscheduler.net/#/
2 changes: 1 addition & 1 deletion config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const config = {
appName: env.APP_NAME,
appColor: env.APP_COLOR,
twitter: env.TWITTER,
port: 4000,
port: 62_893,

// build directory
buildBase: 'build',
Expand Down
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
const API = require('@ladjs/api');
const jwt = require('koa-jwt');

const api = require('./api');
const apiConfig = require('./config/api');

const config = require('./config');
const jwt = require('koa-jwt');

function plugin(opts, Bree) {
opts = {
Expand All @@ -16,7 +17,7 @@ function plugin(opts, Bree) {
...apiConfig,
port: opts.port,
jwt: opts.jwt,
hookBeforeRoutes: (app) => {
hookBeforeRoutes(app) {
app.use(jwt(opts.jwt));
}
});
Expand Down
2 changes: 1 addition & 1 deletion test/plugin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ test('api does exist on bree instance', (t) => {
t.is(typeof bree.api, 'object');

// options is set correctly by default
t.is(bree.api.config.port, 4000);
t.is(bree.api.config.port, 62_893);
t.is(bree.api.config.jwt.secret, 'secret');
});

0 comments on commit 11bb7de

Please sign in to comment.