BasefloorAPIModern Backend Framework
Build powerful APIs with built-in authentication, permissions, and MongoDB integration
Build powerful APIs with built-in authentication, permissions, and MongoDB integration
npm install @basefloor/api
yarn add @basefloor/api
// Create basefloor.config.js
module.exports = (API) => ({
project: {
name: 'My API',
port: 3000
},
database: {
uri: 'mongodb://localhost:27017/myapp'
},
routes: (r) => [
r.post('/users(Users)', { c: true }),
r.get('/users(Users)', { rA: true }),
r.get('/users/:user_id(Users)', { r: true })
]
})
// server.js
const BasefloorAPI = require('@basefloor/api')
const api = BasefloorAPI({
config: require('./basefloor.config.js')
})
BasefloorAPI is the backend framework component of the Basefloor ecosystem. It's designed to be a powerful yet minimal API framework that handles all the common requirements of a modern API, allowing developers to focus on building their application's unique features rather than boilerplate code.
basefloor.config.js
file configures both API and AppWhether you're building a simple REST API or a complex application backend, BasefloorAPI provides the foundation you need to get started quickly and scale effectively.