@views

Configure the location of view code. Architect considers copies view code into HTTP GET handler Lambda functions.

You can also specify to only copy view code to specific lambda functions by listing them directly.

Syntax

  • Routes should be existing @http routes.
  • Route names follow the same requirements as @http routes. see @http

Example

This app.arc file defines specific @http functions to copy src/views/ to:

arc
@app
myapp

@http
get /
get /kittens
get /dogs
get /raccoons

@views
get /kittens
get /raccoons
json
{
  "app": "myapp",
  "http": [
    [ "get", "/" ],
    [ "get", "/kittens" ],
    [ "get", "/dogs" ],
    [ "get", "/raccoons" ]
  ],
  "views": [
    [ "get", "/kittens" ],
    [ "get", "/raccoons" ]
  ]
}
toml
app="myapp"

http=[
  [ "get", "/" ],
  [ "get", "/kittens" ],
  [ "get", "/dogs" ],
  [ "get", "/raccoons" ]
]

views=[
  [ "get", "/kittens" ],
  [ "get", "/raccoons" ]
]

yaml
---
app: testapp

http:
- get: "/"
- get: "kittens"
- get: "dogs"
- get: "raccoons"

views:
- get: "kittens"
- get: "raccoons"