forked from scullyio/scully
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscully.config.js
98 lines (96 loc) · 2.38 KB
/
scully.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/** load the plugin */
require('./extraPlugin/extra-plugin.js');
require('./extraPlugin/tocPlugin');
require('./extraPlugin/voidPlugin');
exports.config = {
/** projectRoot is mandatory! */
projectRoot: './projects/sampleBlog/src/app',
/** outFolder is where the static distribution files end up */
outFolder: './dist/static',
routes: {
'/demo/:id': {
type: 'extra',
numberOfPages: 5,
},
'/home/:topLevel': {
type: 'extra',
data: [
{title: 'All routes in application', data: 'all'},
{title: 'Toplevel routes in application', data: ''},
],
},
'/user/:userId': {
// Type is mandatory
type: 'json',
/**
* Every parameter in the route must exist here
*/
userId: {
url: 'https://jsonplaceholder.typicode.com/users',
property: 'id',
},
},
'/ouser/:userId/:friendId': {
// Type is mandatory
type: 'json',
/**
* Every parameter in the route must exist here
*/
userId: {
url: 'https://jsonplaceholder.typicode.com/users',
property: 'id',
},
friendId: {
/** users are their own friend in this sample ;) */
url: 'https://jsonplaceholder.typicode.com/users?userId=${userId}',
property: 'id',
},
},
'/todos/:todoId': {
// Type is mandatory
type: 'json',
/**
* Every parameter in the route must exist here
*/
todoId: {
url: 'https://jsonplaceholder.typicode.com/todos',
property: 'id',
/**
* Headers can be sent optionally
*/
headers: {
'API-KEY': '0123456789',
},
},
},
'/nouser/:userId/:posts/:comments': {
// Type is mandatory
type: 'json',
/**
* Every parameter in the route must exist here
*/
userId: {
url: 'https://jsonplaceholder.typicode.com/users',
property: 'id',
},
posts: {
url: 'https://jsonplaceholder.typicode.com/posts?userId=${userId}',
property: 'id',
},
comments: {
url: 'https://jsonplaceholder.typicode.com/comments?postId=${posts}',
property: 'id',
},
},
'/blog/:slug': {
type: 'contentFolder',
postRenderers: ['toc'],
slug: {
folder: './blog',
},
},
'/**': {
type: 'void',
},
},
};