@js

@js section defines HTTP routes that return text/javascript content

Syntax

  • Routes must start with a leading slash
  • Dashes and underscores are not allowed

Additional bits

  • Advised maximum of 100 characters
  • Optional Express-style URL parameters denoted with colons (:)
  • Currently only GET supported, read more here

Example

This .arc file defines some typical JS routes:

@app
testapp

@js
/js/index.js
/js/:page

The .arc above generates the following functions:

/
├── js
│   ├── get-js-index-js/
│   └── get-js-000page/
├── .arc
└── package.json

Next: Defining routes with @css