# When using multiple service folders, what should a service's serverless.yml look like for google?

**URL:** <https://forum.serverless.com/t/when-using-multiple-service-folders-what-should-a-services-serverless-yml-look-like-for-google/1992>\
**Category:** Serverless Framework\
**Tags:** google\
**Created:** [June 1, 2017, 8:11pm UTC](https://forum.serverless.com/t/when-using-multiple-service-folders-what-should-a-services-serverless-yml-look-like-for-google/1992 "2017-06-01T20:11:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![k00k](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/k00k/32/696_2.png) [@k00k](https://forum.serverless.com/u/k00k)\
**Post date:** [June 1, 2017, 8:11pm UTC](https://forum.serverless.com/t/when-using-multiple-service-folders-what-should-a-services-serverless-yml-look-like-for-google/1992/1 "2017-06-01T20:11:14Z")

</div>

I’ve created a new service folder with: `sls create --template google-nodejs —path customers`.

This created a folder called `customers/` with 3 files in it: `index.js`, `package.json`, & `serverless.yml`.

Now I’m editing `customers/serverless.yml` and i’m just curious as to proper formatting for multiple functions (CRUD-like).

I found a couple different formats out in the wild, and have read the docs, but I’m having trouble. Can someone tell me what’s wrong with the following, I keep getting `Deployment failed: RESOURCE ERROR - Name in request must be equal to the name of the function`. Here are the relevant lines from `customers/serverless.yml`:

```auto
functions:
  create:
    handler: create
    events:
      - http:
        path: customers
        method: post
  list:
    handler: list
    events:
      - http:
        path: customers
        method: get

```

---

<div class="post-metadata">

**Author:** ![DavidWells](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/davidwells/32/201_2.png) [@DavidWells](https://forum.serverless.com/u/DavidWells)\
**Post date:** [June 1, 2017, 11:43pm UTC](https://forum.serverless.com/t/when-using-multiple-service-folders-what-should-a-services-serverless-yml-look-like-for-google/1992/2 "2017-06-01T23:43:51Z")

</div>

Looks like the path to your code is incomplete.

Change `create` to `index.create` in the handler prop. (do the same for all the functions.)

```auto
functions:
  create:
    handler: index.create
    events:
      - http:
        path: customers
        method: post

```

This should fix your issue

---

<div class="post-metadata">

**Author:** ![k00k](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/k00k/32/696_2.png) [@k00k](https://forum.serverless.com/u/k00k)\
**Post date:** [June 2, 2017, 3:20pm UTC](https://forum.serverless.com/t/when-using-multiple-service-folders-what-should-a-services-serverless-yml-look-like-for-google/1992/3 "2017-06-02T15:20:24Z")

</div>

That gives me the following:

```auto
Error: The "handler" property for the function "hello" is invalid. 
Handlers should be plain strings referencing only the exported function name without characters such as "." or "/" (so e.g. "http" instead of "index.http"). 
Do you want to nest your functions code in a subdirectory?
Google solves this by utilizing the "main" config in the projects package.json file. Please check the docs for more info.

```

Regardless, I have since tried about every permutation of that snippet imaginable. And the only way I can get it to run is with the default that is created from the google-nodejs template and a function named `http`. I would LOVE for you guys to create an example working repo for google that has multiple services/folders as one might use to break out CRUD functionality by “model”.

---

<div class="post-metadata">

**Author:** ![antypko](https://avatars.discourse-cdn.com/v4/letter/a/ac8455/32.png) [@antypko](https://forum.serverless.com/u/antypko)\
**Post date:** [June 11, 2018, 12:48pm UTC](https://forum.serverless.com/t/when-using-multiple-service-folders-what-should-a-services-serverless-yml-look-like-for-google/1992/4 "2018-06-11T12:48:43Z")

</div>

It’s really unclear error message. But the issue is that `function` and `handler` names should not be the same. So, in your example valid config could look like this:

```auto
functions:
  createFunction:
    handler: create
    events:
      - http:
        path: customers
        method: post
  listFunction:
    handler: list
    events:
      - http:
        path: customers
        method: get

```
