# Control ZIP file folder structure

**URL:** <https://forum.serverless.com/t/control-zip-file-folder-structure/985>\
**Category:** Serverless Framework\
**Created:** [December 20, 2016, 2:28pm UTC](https://forum.serverless.com/t/control-zip-file-folder-structure/985 "2016-12-20T14:28:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rmtuckerphx](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/rmtuckerphx/32/358_2.png) [@rmtuckerphx](https://forum.serverless.com/u/rmtuckerphx)\
**Post date:** [December 20, 2016, 2:28pm UTC](https://forum.serverless.com/t/control-zip-file-folder-structure/985/1 "2016-12-20T14:28:17Z")

</div>

I am using serverless 1.4.0 and have my **handler.js** file under a **src** folder. When I deploy and then look at the ZIP file under the **.serverless** folder the folder structure inside the ZIP includes the **src** folder. Is there a way so that the contents of the **src** folder will be at the root level inside the ZIP and not have **src** be at the root level?

---

<div class="post-metadata">

**Author:** ![rowanu](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/rowanu/32/75_2.png) [@rowanu](https://forum.serverless.com/u/rowanu)\
**Post date:** [December 20, 2016, 7:00pm UTC](https://forum.serverless.com/t/control-zip-file-folder-structure/985/2 "2016-12-20T19:00:31Z")

</div>

No, not at the moment. Changing the location of the handler file at deploy time would mean that the handler function reference in your `serverless.yml` would need to be changed too.

What’s the benefit you’re after? Why not just put your `serverless.yml` in your `src/` folder too? Then all of your `src/` will be the top-level of your service.

---

<div class="post-metadata">

**Author:** ![rmtuckerphx](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/rmtuckerphx/32/358_2.png) [@rmtuckerphx](https://forum.serverless.com/u/rmtuckerphx)\
**Post date:** [December 20, 2016, 10:48pm UTC](https://forum.serverless.com/t/control-zip-file-folder-structure/985/3 "2016-12-20T22:48:22Z")

</div>

Moving the serverless.yml file inside the src folder was what I needed to do. Thank you.

---

<div class="post-metadata">

**Author:** ![gmetzker](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/gmetzker/32/338_2.png) [@gmetzker](https://forum.serverless.com/u/gmetzker)\
**Post date:** [March 14, 2017, 2:25pm UTC](https://forum.serverless.com/t/control-zip-file-folder-structure/985/4 "2017-03-14T14:25:41Z")

</div>

For packaging it would be nice if we could specify the target location in side the ZIP location.

I have a similar project setup and just to keep the project clean I really wanted to keep my source code in `src` and my `serverless.yaml` at the root of the repo.

It’s also required if you are using python with a virtual environment because lambda requires copying the pip dependencies from `$VIRTUAL_ENV/lib/python2.7/site-packages` to the root of the zip file. [See some docs here.](http://docs.aws.amazon.com/lambda/latest/dg/lambda-python-how-to-create-deployment-package.html).
