Using Netlify CLI i typed netlify deploy --prod in my express app and i get:
✔ Finished uploading blobs to deploy store
✔ No cached functions were found
✔ Finished hashing
✔ CDN requesting 0 files
✔ Finished uploading 0 assets
✔ Deploy is live!
Build logs: https://app.netlify.com/abcxyz
Function logs: https://app.netlify.com/abcxyz/functions
Unique deploy URL: https://app.netlify.com/abcxyzp
Website URL: https://app.netlify.com/abcxyz
In production i sent for example:
POST http://localhost:3000/api/v1/token
so i tried in POSTMAN:
https://app.netlify.com/abcxyz/api/v1/token
but it didnt work. I get:
Bad request, missing form
My netlify.toml
[functions]
external_node_modules = ["express"]
node_bundler = "esbuild"
[[redirects]]
force = true
from = "/api/*"
status = 200
to = "/.netlify/functions/api/:splat"
and api.ts copied from netlify docs:
import express, { Router } from 'express';
import serverless from 'serverless-http';
const api = express();
const router = Router();
router.get('/hello', (req, res) => res.send('Hello World!'));
api.use('/api/', router);
export const handler = serverless(api);
How to send any request to deployed server on netlify that actually works?
