# Following Express guide: "Missing Authentication Token" at Hello world?

**URL:** <https://forum.serverless.com/t/following-express-guide-missing-authentication-token-at-hello-world/12169>\
**Category:** Serverless Framework\
**Tags:** aws\
**Created:** [August 1, 2020, 4:55am UTC](https://forum.serverless.com/t/following-express-guide-missing-authentication-token-at-hello-world/12169 "2020-08-01T04:55:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jackvhall](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/jackvhall/32/4453_2.png) [@jackvhall](https://forum.serverless.com/u/jackvhall)\
**Post date:** [August 1, 2020, 4:55am UTC](https://forum.serverless.com/t/following-express-guide-missing-authentication-token-at-hello-world/12169/1 "2020-08-01T04:55:11Z")

</div>

Hello, I’m using the following guide to setup an express serverless app:

> **[Deploy a REST API using Serverless, Express and Node.js](https://www.serverless.com/blog/serverless-express-rest-api/)**
>
> Learn how to use the popular Express.js framework to deploy a REST API with Serverless, DynamoDB and API Gateway.

Unfortunately, it seems somewhat out of date (it’s not dated). Something is occurring where the middleware for app.get(’/’) works fine, but anything passed that returns this message:

```json
{
  "message": "Missing authentication token."
}

```

I’m not sure what is going on. My index.js looks identical to that in the guide. I tried logging at the top of the body of each subsequent middleware function to see if they are even getting called, and it doesn’t appear that they are. I think this has something to do with the definitions for the routes in serverless.yml.

It does not seem to like this:

```auto
functions:

  app:
    handler: index.handler
    events:
      - http: ANY /
      - http: 'ANY {proxy+}'

```

Any pointers in the right direction would be so appreciated. Thanks.

---

<div class="post-metadata">

**Author:** ![jackvhall](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/jackvhall/32/4453_2.png) [@jackvhall](https://forum.serverless.com/u/jackvhall)\
**Post date:** [August 1, 2020, 5:02am UTC](https://forum.serverless.com/t/following-express-guide-missing-authentication-token-at-hello-world/12169/2 "2020-08-01T05:02:24Z")

</div>

> [@jackvhall](#):
>
> ` - http: 'ANY {proxy+}'`

Sorry. A little bit more patience would have led me to correct the error sooner. The guide showed the http event wrapped in a string, which is wrong. It would be nice if these articles accepted pull requests - that guide is full of errors.

---

<div class="post-metadata">

**Author:** ![romanr](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/romanr/32/4945_2.png) [@romanr](https://forum.serverless.com/u/romanr)\
**Post date:** [January 7, 2021, 6:20pm UTC](https://forum.serverless.com/t/following-express-guide-missing-authentication-token-at-hello-world/12169/3 "2021-01-07T18:20:10Z")

</div>

What is the solution, can you elaborate?

---

<div class="post-metadata">

**Author:** ![rsshilli](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/rsshilli/32/7525_2.png) [@rsshilli](https://forum.serverless.com/u/rsshilli)\
**Post date:** [June 13, 2023, 5:16pm UTC](https://forum.serverless.com/t/following-express-guide-missing-authentication-token-at-hello-world/12169/4 "2023-06-13T17:16:36Z")

</div>

The solution for me was that I was using curl to access my new API with something like:

`curl https://xxxxxxx.execute-api.us-east-1.amazonaws.com/dev/myfunc`

but that uses **GET** by default, and I had configured my function to use **POST**. So I needed to run:

`curl -X POST https://xxxxxxx.execute-api.us-east-1.amazonaws.com/dev/myfunc`

Then it worked (and i got an internal error) but that’s another issue. This “Missing authentication token.” is just a super bad error message. You have to configure each error message separately in API Gateway or else it uses the default.
