> For the complete documentation index, see [llms.txt](https://feathersjs-mongoose.gitbook.io/feathers-mongoose-casl/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://feathersjs-mongoose.gitbook.io/feathers-mongoose-casl/docs/start-new-project-1/install-dependency.md).

# Swagger, Logger, BodyParser

#### 1-install dependency

```
npm i feathers-swagger feathers-logger body-parser --save
```

#### 2- Add to src/app.js

{% tabs %}
{% tab title=" src/app.js" %}

```javascript
// 1 - Add this requires 
const bodyParser = require('body-parser');
const swagger = require('feathers-swagger');
const feathersLogger = require('feathers-logger');

// const app = express(feathers());
// 2 - add this lines after const app = express(feathers()):

app.configure(feathersLogger(logger));
app.use(bodyParser.json({limit: '10mb'}));
app.use(bodyParser.urlencoded({limit: '10mb', extended: true }));
// Swagger
if(process.env.NODE_ENV !== 'production'){
  app.configure(swagger({
    docsPath: '/docs',
    uiIndex: true, //path.join(__dirname, 'docs.html'),
    info: {
      title: 'feathersjs-server docs',
      description: 'feathersjs-server api'
    }
  }));
}

```

{% endtab %}

{% tab title=" src/app.js reulst" %}

```javascript
const path = require('path');
const favicon = require('serve-favicon');
const compress = require('compression');
const helmet = require('helmet');
const cors = require('cors');
const logger = require('./logger');

const feathers = require('@feathersjs/feathers');
const configuration = require('@feathersjs/configuration');
const express = require('@feathersjs/express');
const socketio = require('@feathersjs/socketio');
const {authentication} = require('feathers-mongoose-casl');

const middleware = require('./middleware');

const services = require('./services');
const appHooks = require('./app.hooks');
const channels = require('./channels');

const mongoose = require('./mongoose');
const bodyParser = require('body-parser');
const swagger = require('feathers-swagger');
var feathersLogger = require('feathers-logger');

const app = express(feathers());

app.configure(feathersLogger(logger));
app.use(bodyParser.json({limit: '10mb'}));
app.use(bodyParser.urlencoded({limit: '10mb', extended: true }));
// Swagger
app.configure(swagger({
  docsPath: '/docs',
  uiIndex: true, //path.join(__dirname, 'docs.html'),
  info: {
    title: 'feathersjs-server docs',
    description: 'feathersjs-server api'
  }   
}));

// Load app configuration
app.configure(configuration());
// Enable security, CORS, compression, favicon and body parsing
app.use(helmet());
app.use(cors());
app.use(compress());
app.use(express.json());
app.use(express.urlencoded({ extended: true }));
app.use(favicon(path.join(app.get('public'), 'favicon.ico')));

// Host the public folder
app.use('/', express.static(app.get('public')));

// Set up Plugins and providers
app.configure(express.rest());
app.configure(socketio());

app.configure(mongoose);

// Configure other middleware (see `middleware/index.js`)
app.configure(middleware);
app.configure(authentication);
// Set up our services (see `services/index.js`)
app.configure(services);
// Set up event channels (see channels.js)
app.configure(channels);

// Configure a middleware for 404s and the error handler
app.use(express.notFound());
app.use(express.errorHandler({ logger }));

app.hooks(appHooks);

module.exports = app;

```

{% endtab %}
{% endtabs %}

```
git add .
git commit -m "add bodyParser to handle files, swagger and feathersLogger"
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://feathersjs-mongoose.gitbook.io/feathers-mongoose-casl/docs/start-new-project-1/install-dependency.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
