“Serverless-offline: route not found.” running an AWS Lambda function in offline mode

Looks like you've got a whitespace issue in your serverless.yml file.

Try indenting path and method under the http block:

functions:
  hello:
    handler: src/handler.main
    events:
      - http:
          path: /hello
          method: any

for setup a quick example using serverless template :

sls create -h

output :

create ........................ Create new Serverless service
--template / -t .................... Template for the service. Available templates: "aws-clojure-gradle", "aws-clojurescript-gradle", "aws-nodejs", "aws-nodejs-typescript", "aws-alexa-typescript", "aws-nodejs-ecma-script", "aws-python", "aws-python3", "aws-groovy-gradle", "aws-java-maven", "aws-java-gradle", "aws-kotlin-jvm-maven", "aws-kotlin-jvm-gradle", "aws-kotlin-nodejs-gradle", "aws-scala-sbt", "aws-csharp", "aws-fsharp", "aws-go", "aws-go-dep", "aws-go-mod", "aws-ruby", "aws-provided", "azure-nodejs", "cloudflare-workers", "cloudflare-workers-enterprise", "cloudflare-workers-rust", "fn-nodejs", "fn-go", "google-nodejs", "google-python", "google-go", "kubeless-python", "kubeless-nodejs", "openwhisk-java-maven", "openwhisk-nodejs", "openwhisk-php", "openwhisk-python", "openwhisk-ruby", "openwhisk-swift", "spotinst-nodejs", "spotinst-python", "spotinst-ruby", "spotinst-java8", "plugin" and "hello-world"

step1: so for generated a new nodejs example with an api :

sls create -t aws-nodejs-ecma-script -n service-name-hello-world

step2: install serverless-offline :

npm install serverless-offline -D

step3: in serverless.yml

plugins:
  - serverless-webpack
  - serverless-offline

step4 : start local server

serverless offline start -r us-west-1 --stage dev

github Example

git clone https://github.com/ysfmag/aws-serverless-nodejs-example
cd aws-serverless-nodejs-example
yarn 
yarn start 

serverless.yml

to define an api in your serverless framework you need to respect yaml format , and in the path variable you dont need to start with '/hello' just 'hello' will work .

functions:
  hello:
  handler: src/handler.main
  events:
    - http:
        path: hello
        method: get