Hi, is there a way to do this in SST? ```const se...
# help
g
Hi, is there a way to do this in SST?
Copy code
const serverless = require('serverless-http');
const express = require('express')
const app = express()

app.get('/', function (req, res) {
  res.send('Hello World!')
})

module.exports.handler = serverless(app);
t
That should work in sst but I strongly recommend not using express with serverless
g
I understand. I am planning to migrate my express application to sst. Just in the meantime, that would I want to do first.
How can I export the express app in sst?
got it hehehehe!
the code above is working hehehe!
t
Ah gotcha
h
@thdxr Curious to hear why you don’t recommend using express with serverless.
t
You can use it and it'll work fine but you're sort of avoiding embracing the actual serverless patterns and using CDK constructs to define your routes
There's benefits to having AWS be aware of that stuff for observability. Can also do schema validations there as well
Basically you're shipping express to do a bunch of work that AWS can already do for you