Functions
Server-side code that works as API endpoints with global scale.
export default (req: Request, res: Response) => {
res.status(200).send('Hello world')
}
Serverless Functions at Scale
Handle custom logic, specific business requirements, and custom integrations using Nhost Functions.
import nodemailer from 'nodemailer'
export default async (req, res) => {
let transporter = nodemailer.createTransport({
host: process.env.SMTP_HOST,
port: process.env.SMTP_PORT,
secure: true,
auth: {
user: process.env.SMTP_USER,
pass: process.env.SMTP_PASS,
}
})
let info = await transporter.sendMail({
from: '"Fred Foo 👻" <foo@example.com>',
to: 'bar@example.com, baz@example.com',
subject: 'Hello ✔',
text: 'Hello world?',
html: '<b>Hello world?</b>'
})
res.json('Message sent')
}
And more...
Environment Variables
Full access to system and manually defined environment variables.
TypeScript-Ready
Deploy your TypeScript functions with ease.
Event Triggers
Use Functions to consume event triggers.
Zero Maintenance
Functions are automatically scaled and maintained.
There is more
Other features
Hasura
Role-Based Permissions, Web Console, Event Triggers, Cron Jobs, and more.
Functions
Run custom code using JavaScript and TypeScript with infinite scale.
Ready to try Nhost?
Start building
Questions? Talk to us.