You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remember to use the [-p](https://docs.docker.com/engine/reference/run/) flag to expose the container port where the application is listening (3000 by default).
40
+
41
+
NOTE: If you want to use `killgrave` through Docker at the same time you use your own dockerised HTTP-based API, be careful with networking issues.
42
+
32
43
## Using Killgrave
33
44
34
45
Use `killgrave` with default flags:
@@ -39,6 +50,8 @@ $ killgrave
39
50
```
40
51
Or custome your server with this flags:
41
52
```sh
53
+
-config string
54
+
path with configuration file
42
55
-host string
43
56
if you run your server on a different host (default "localhost")
44
57
-imposters string
@@ -49,6 +62,28 @@ Or custome your server with this flags:
49
62
show the version of the application
50
63
```
51
64
65
+
Use `killgrave` with config file:
66
+
67
+
First of all you need create a file with a valid config, i.e:
68
+
69
+
```yaml
70
+
#config.yml
71
+
72
+
imposters_path: "imposters"
73
+
port: 3000
74
+
host: "localhost"
75
+
cors:
76
+
methods: ["GET"]
77
+
headers: ["Content-Type"]
78
+
exposed_headers: ["Cache-Control"]
79
+
origins: ["*"]
80
+
allow_credentials: true
81
+
```
82
+
83
+
The parameter `cors` is optional and his options can be empty array, the other options `imposters_path`, `port`, `host` are mandatory.
84
+
85
+
If you want more information about the CORS options, visit the [CORS section](#CORS).
The application is also available through [Docker](https://hub.docker.com/r/friendsofgo/killgrave), just run:
218
+
If you want to use `killgrave` on your client application you must consider to configure correctly all about CORS, thus we offer the possibility to configure as you need through a config file.
184
219
185
-
```bash
186
-
docker run -it --rm -p 3000:3000 friendsofgo/killgrave
187
-
```
220
+
In the CORS section of the file you can find the next options:
188
221
189
-
Remember to use the [-p](https://docs.docker.com/engine/reference/run/) flag to expose the container port where the application is listening (3000 by default).
222
+
- **methods** (string array)
223
+
224
+
Represent the **Access-Control-Request-Method header**, if you don't specify it or if you do leave it as any empty array, the default values will be:
190
225
191
-
NOTE: If you want to use `killgrave` through Docker at the same time you use your own dockerised HTTP-based API, be careful with networking issues.
0 commit comments