---
title: Events - HTTP - CORS
---

## Hook it up with a function

`FUNCTION/squeezer.yml` :

```yaml
event:
  type: http
  path: /rest/v1/hello
  method: get
```

## CORS

https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS

Enable it for all functions `PROJECT_DIR/squeezer.yml` 

```yaml
stage:
  CORS: 'enabled'
```

It will add this headers for every HTTP return payload :

```
Access-Control-Allow-Headers:*
Access-Control-Allow-Method:*
Access-Control-Allow-Origin:*
```
