Skip to content

Commit

Permalink
Merge pull request #58 from FlorianRappl/develop
Browse files Browse the repository at this point in the history
Order File References
  • Loading branch information
FlorianRappl authored Oct 14, 2022
2 parents 01df1fe + d0fbe3f commit 70c4a31
Show file tree
Hide file tree
Showing 13 changed files with 258 additions and 155 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
# Changelog

## 0.15.2

- Support for different hostname bindings (default: `0.0.0.0`)
- Added ordering of files to be deterministic (#57)
- Updated dependencies

## 0.15.1

- Support for reading certificates from node_modules
- Support for reading certificates from `node_modules`

## 0.15.0

Expand Down
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Efficient server proxying and mocking in Node.js. :muscle:

![kras logo](https://github.com/FlorianRappl/kras/raw/master/logo.png)
![kras logo](https://github.com/FlorianRappl/kras/raw/main/logo.png)

The README is supposed to only give you a basic idea what kras *is*. To *truly find out* about all the possibilities and details the [getting started](docs/getting-started.md) document will give you the right pointers and pieces of information.

Expand Down Expand Up @@ -74,9 +74,11 @@ If specified the command line options have higher precedence. The following opti
-c, --config Sets the configuration file to use, by default .krasrc
[string]
-p, --port Sets the port of the server, by default 9000 [number]
-n, --name Sets the name of the server, by default kras v0.14.0 [string]
-n, --name Sets the name of the server, by default kras v0.15.2 [string]
-d, --dir Sets the base directory of the server, by default
/home/rapplf/Code/Piral/kras/mocks [string]
--host Sets the host binding of the server, by default 0.0.0.0
[string]
--cert Sets the certificate of the server, by default
/home/rapplf/Code/Piral/kras/cert/server.crt [string]
--key Sets the key of the server, by default
Expand All @@ -87,6 +89,8 @@ If specified the command line options have higher precedence. The following opti
--map Sets the different mappings, e.g.,
"--map./=https://httpbin.org"; can be used multiple times
[default: {}]
--version Show version number [boolean]
-h, --help Shows the argument descriptions [boolean]
```

The `.krasrc` is a simple JSON format. An example is the following configuration:
Expand All @@ -95,6 +99,7 @@ The `.krasrc` is a simple JSON format. An example is the following configuration
{
"name": "kras",
"port": 9000,
"host": "0.0.0.0",
"directory": ".",
"uploadLimit": 10,
"logLevel": "error",
Expand Down
93 changes: 51 additions & 42 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kras",
"version": "0.15.1",
"version": "0.15.2",
"description": "Efficient server proxying and mocking in Node.js.",
"main": "dist/server/index.js",
"types": "dist/server/index.d.ts",
Expand Down Expand Up @@ -56,7 +56,7 @@
"@types/body-parser": "^1.19.2",
"@types/chokidar": "^2.1.3",
"@types/cookie": "^0.4.1",
"@types/express": "^4.17.13",
"@types/express": "^4.17.14",
"@types/express-ws": "^3.0.1",
"@types/faker": "^5.5.9",
"@types/form-data": "^2.5.0",
Expand All @@ -70,22 +70,22 @@
"@zeit/ncc": "^0.22.3",
"accept-language-parser": "^1.5.0",
"babel-jest": "^26.6.3",
"body-parser": "^1.20.0",
"body-parser": "^1.20.1",
"chalk": "^3.0.0",
"chokidar": "^3.5.3",
"cookie": "^0.4.2",
"cross-env": "^7.0.3",
"dets": "^0.10.2",
"enzyme-to-json": "^3.6.2",
"express": "^4.18.1",
"express": "^4.18.2",
"express-ws": "^4.0.0",
"faker": "^5.5.3",
"form-data": "^3.0.0",
"jest": "^26.6.3",
"mixin-deep": "^2.0.1",
"multer": "^1.4.5-lts.1",
"nodemon": "^2.0.19",
"prettier": "^2.7.0",
"nodemon": "^2.0.20",
"prettier": "^2.7.1",
"request": "^2.88.2",
"send": "^0.17.2",
"ts-jest": "^26.5.6",
Expand All @@ -95,6 +95,6 @@
"tslint-plugin-prettier": "^2.3.0",
"typescript": "^3.9.10",
"uuid": "^8.3.2",
"ws": "^7.5.8"
"ws": "^7.5.9"
}
}
3 changes: 3 additions & 0 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ const argv = yargs
.string('d')
.alias('d', 'dir')
.describe('d', `Sets the base directory of the server, by default ${defaultConfig.directory}`)
.string('host')
.describe('host', `Sets the host binding of the server, by default ${defaultConfig.host}`)
.string('cert')
.describe('cert', `Sets the certificate of the server, by default ${defaultConfig.ssl.cert}`)
.string('key')
Expand All @@ -38,6 +40,7 @@ const argv = yargs
runFromCli(
{
port: argv.p,
host: argv.host,
name: argv.n,
logs: argv.l as LogLevel,
cert: argv.cert,
Expand Down
Loading

0 comments on commit 70c4a31

Please sign in to comment.