Hello world

noonjs allows you to easily extend your backend by attaching custom Express routers. This is helpful when you want to add custom endpoints outside of the auto-generated CRUD routes.

import Noonjs from "noonjs"
import config from "../config.json"
import express from "express"

const noonjs = new Noonjs(config)

const router = express.Router()

router.get("/hello", (req, res) => {
    res.send("world")
})

noonjs.use(router)

noonjs.start()

In the example above, a custom Express router is created using express.Router(). A simple GET route /hello is defined that responds with the string "world". This router is then attached to the noonjs instance using noonjs.use(router). Finally, noonjs.start() is called to launch the server, combining both the auto-generated CRUD routes and your custom ones. This approach provides flexibility to add your own logic alongside Noonjs's automatic functionality.

Edit this page on Github
© 2025 kav3.com. Crafted with and dedication.