gramex.yaml 1.74 KB
Newer Older
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
# Generated by gramex init 1.58.0 (don't delete this line)
# on 2020-02-24 by Pratap Vardhan <pratap.vardhan@gramener.com>

# Configurations for app: pdftra
# ----------------------------------------------------------------------------
url:
  pdftra-home:
    pattern: /$YAMLURL/
    handler: FileHandler
    kwargs:
      path: $YAMLPATH/index.html
      # See https://learn.gramener.com/guide/auth/#authorization for auth rules
      auth: true
      template: true
      headers:
        Cache-Control: private, max-age=1
    cache: {expiry: {duration: 1}}

  pdftra-upload:
    pattern: /$YAMLURL/upload
    handler: UploadHandler
    kwargs:
      path: $YAMLPATH/data/upload/

  pdftra-pdftojson:
    pattern: /$YAMLURL/pdftojson
    handler: FunctionHandler
    kwargs:
      function: pdftra.pdftojson
      path: $YAMLPATH/data/upload/

  pdftra-login:
    # Default login_url is /login/. If you change this, change auth.login_url
    # https://learn.gramener.com/guide/auth/#login-urls
    pattern: /$YAMLURL/login/
    # You MUST change the auth before deploying. DBAuth is commonly used.
    # See https://learn.gramener.com/guide/auth/#database-auth
    handler: SimpleAuth
    kwargs:
      template: $YAMLPATH/login.html
      credentials: { pdfmaker: pdf2020pass }
Pratap Vardhan's avatar
Pratap Vardhan committed
42
43
44
45
      redirect:
        query: next
        header: Referer
        url: /$YAMLURL/
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62

  pdftra-logout:
    pattern: /$YAMLURL/logout/
    handler: LogoutHandler

# Gramex init configurations for app: pdftra
# ----------------------------------------------------------------------------
import:
  # /ui/ has Gramex UI components -- use this like the node_modules/ directory
  ui:
    path: $GRAMEXAPPS/ui/gramex.yaml
    YAMLURL: $YAMLURL/ui/

test:
  auth:
    user: pdfmaker
    password: pdf2020pass