Examples

Explore real-world examples and patterns using Aroma.js Framework.

Basic API Route
Create a simple REST API endpoint
app.get('/api/hello', (req,res) => {
  res.json({ message: 'Hello World' });
})
Authentication
Protect routes with authentication


app.get('/admin/dashboard', (req,res) => {
  const user = req.headers.Authorization;
  res.send(user);
})
Database Operations
Work with databases using built-in clients
app.post('/api/users', async (req, res) => {
  const body = req.body;
  const user = await db.users.create({
    data: body
  })
  res.json({user});
})