Skip to content

Commit b17a887

Browse files
committed
names update and Fiction[] reference
1 parent a00b8bb commit b17a887

6 files changed

Lines changed: 28 additions & 8 deletions

File tree

-140 Bytes
Binary file not shown.

src/content/docs/guides/dynamic-routes.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ sidebar:
55
---
66
Fiction provides full support for dynamic routing, but works different way for other popular frameworks.
77

8-
Dynamic routes can be defined with [FictionServeDynamicPath](/reference/fictionservedynamicpath) function the same way as any other static route.
8+
Dynamic routes can be defined with [fiction.serveDynamic](/reference/fictionservedynamic) function the same way as any other static route.
99

1010
```sh
1111
fiction.serveDynamic "<route>" "<function>" "<content type>"
@@ -31,5 +31,3 @@ Request path:
3131
3232
[page] => $page => page1
3333
```
34-
35-
You can either use the variable directly or call `getSlug <slug>` function to get it's value

src/content/docs/guides/getting-started.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ By default, Fiction uses `socat` for connection.
2121

2222
If your machine doesn't include `socat`, change `core` option to bash (`core=bash`) or other supported core, or install socat with your system's package manager if possible.
2323

24-
```diff lang="sh"
24+
```diff lang="sh" title="src/index.shx"
2525
- fiction.server "0.0.0.0:8080" core="socat"
2626
+ fiction.server "0.0.0.0:8080" core="bash"
2727
```
@@ -52,25 +52,25 @@ If your machine doesn't include `socat`, change `core` option to bash (`core=bas
5252
<Tabs>
5353
<TabItem label="fiction">
5454
```sh
55-
fiction run
55+
fiction dev
5656
```
5757
</TabItem>
5858
<TabItem label="bash">
5959
Fiction would automatically load and execute the main file with `bashx`
6060
```sh
61-
bash index.shx
61+
bash src/index.shx
6262
```
6363
</TabItem>
6464
<TabItem label="bashx">
6565
You can also use bashx directly to start the file
6666
```sh
67-
bashx index.shx
67+
bashx src/index.shx
6868
```
6969
</TabItem>
7070
</Tabs>
7171

7272
5. ### Check if the server is working
7373

74-
Open `<server IP>:8080` in your browser; If you see the default page, Fiction is working and you can start editing the code in `index.shx` file.
74+
Open `<server IP>:8080` in your browser; If you see the default page, Fiction is working and you can start editing the code in `index.shx` file in `src` folder.
7575

7676
</Steps>
File renamed without changes.
File renamed without changes.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
title: Fiction[]
3+
---
4+
Main configuration array of Fiction webserver.
5+
6+
| Key | Description | Type | Default value | Changeable |
7+
| --- | --- | --- | --- | --- |
8+
| version | Version of framework | string | <latest> | false |
9+
| path | Fiction's absolute path | string | ${FICTION_PATH} | false |
10+
| routes | Array for routes | array | FictionRoute | true* |
11+
| modules | Array containing module names | array | FictionModule | true* |
12+
| response | Array for response arguments | array | FictionResponse | true* |
13+
| request | Array for request information | array | Request | true* |
14+
| mode | Webserver mode (development/production) | string | production | true* |
15+
| core | Network utility to use for requests (ncat/netcat/socat/bash) | string | socat | true |
16+
| expose_addr | Whether show incoming IP in logs or not | boolean | true | true |
17+
| show_headers | Show request headers (development mode only) | boolean | false | true |
18+
| hot_reload | Whether enable Hot-Reload or not (production mode only, development mode enables hot-reload automatically) | boolean | false | true |
19+
| encode_routes | Whether encode routes storage file or not | boolean | false | true |
20+
| default_index | Default index file to execute (bashx, fiction run/dev/build) | string | src/index.shx | true |
21+
22+
\* while following key is changeable, it's not recommended to change it because it can cause issues

0 commit comments

Comments
 (0)