# How to mark which routes are writes

Map the routes that change something to a class, mark the forms that post to them, and check the pass on the server. Leave ordinary GET, HEAD, and OPTIONS requests unmarked so they stay free reads.

In a Node config, the route list starts with a read prefix for `/`, then the prefixes you want to protect:

```yaml
routes:
  - { prefix: "/", class: read }
  - { prefix: "/search", class: search }
  - { prefix: "/contact", class: write }
  - { prefix: "/login", class: account }
```

On the page, use the same class in `data-attackfee`:

```html
<form method="post" action="/contact" data-attackfee="write">
```

The attribute tells the page script which class of work to earn. The middleware, or `attackfee_wp_verify_request` on WordPress, is what actually refuses a write without a valid pass.

Search is 1x, write is 4x, account is 8x, and admin is 16x. See [What are Attackfee action classes?](/learn/concepts/action-classes) for what each class is for.

## Where Attackfee fits

Mark only the write surfaces. The [server docs](/docs/server) have the full config. For the form itself, see [How to add Attackfee to a form](/learn/concepts/how-to-add-attackfee-to-a-form).

- [Attackfee](/)
- [Learn](/learn)
- [Concepts](/learn/concepts)
- [How to mark which routes are writes](/learn/concepts/how-to-mark-routes)

## Related

- [Attackfee Learning Center](/learn)
- [What are Attackfee action classes?](/learn/concepts/action-classes)
- [How to add Attackfee to a form](/learn/concepts/how-to-add-attackfee-to-a-form)
- [How to check writes on your own server](/learn/concepts/how-to-check-writes-on-your-server)
- [Server](/docs/server)

## Questions



### "Do I have to mark every route?"

"No. Mark the ones that change something. Unmapped GET, HEAD, and OPTIONS stay free reads. An unmapped POST counts as a write."

### "What if the form attribute and the server class disagree?"

"The server check is what counts. The attribute tells the page script which class of work to earn. Keep them the same."

### "Can I gate a page view?"

"The product is built so GET stays free. Node will refuse a config that gates page views unless a confirm setting is on, and you should leave that off. The edge worker and the WordPress plugin never gate a GET."

### "How do I mark a posted search box?"

"Use data-attackfee=search on the form, and map that route to the search class on the server."

### "Does marking a route on the page protect it by itself?"

"No. The server still has to check the pass."
