<commit_before>MongooseAdmin
=============

Minimalist admin page for Node.js projects using Mongoose and Express.js.


Why
---
Main usage will be for small projects where you need an admin page for CRUD operations.
Just add it as a middleware and use it.
When your project grows and you have spent days to develop you own admin page, you can remove MongooseAdmin.

Screenshots
-----------
![Screenshot](https://raw.githubusercontent.com/Webura/mongooseadmin/master/screenshots/login.png "Screenshot")
![Screenshot](https://raw.githubusercontent.com/Webura/mongooseadmin/master/screenshots/mongooseadmin.png "Screenshot")

What to expect
--------------
1. Create CRUD operations on the models defined in Mongoose
2. Hook it in as a Express.js middleware.
3. Options to change authentication etc.


Install
-------
`npm install mongooseadmin`

How to use
----------
Basic usage
```
var mongooseadmin = require('mongooseadmin');
app.use(mongooseadmin('/admin'));
```



Options
-------
You can extend with options:

```
var options = {
    title: 'My awesome admin page';
    }
app.use(mongooseadmin('/admin', options));
```

*title* - Changes the page title. Default is 'mongooseadmin'.

*authentication* - A function that takes the parameters username, password and callback.
The callback expects to receive a boolean value for if the username and password is valid. Example
```
var options = {
    authentication:
        function (username, password, callback) {
            callback(username == 'johndoe' && password == '<PASSWORD>');
        }
    };
```

*css* - Add your own css file. Example:
```
var options = {
    css: '/public/myown.css'
    };
```

*js* - Add your own javascript file. Example:
```
var options = {
    css: '/public/myown.js'
    };
```

*login* - Add your own login url. Just add a FORM that post to your admin url with username and password. Example:
```
var options = {
    css: '/login'
    };
```<commit_msg>added more options<commit_after>MongooseAdmin
=============

Minimalist admin page for Node.js projects using Mongoose and Express.js.


Why
---
Main usage will be for small projects where you need an admin page for CRUD operations.
Just add it as a middleware and use it.
When your project grows and you have spent days to develop you own admin page, you can remove MongooseAdmin.

Screenshots
-----------
![Screenshot](https://raw.githubusercontent.com/Webura/mongooseadmin/master/screenshots/login.png "Screenshot")
![Screenshot](https://raw.githubusercontent.com/Webura/mongooseadmin/master/screenshots/mongooseadmin.png "Screenshot")

What to expect
--------------
1. Create CRUD operations on the models defined in Mongoose
2. Hook it in as a Express.js middleware.
3. Options to change authentication etc.


Install
-------
`npm install mongooseadmin`

How to use
----------
Basic usage
```
var mongooseadmin = require('mongooseadmin');
app.use(mongooseadmin('/admin'));
```



Options
-------
You can extend with options:

```
var options = {
    title: 'My awesome admin page';
    }
app.use(mongooseadmin('/admin', options));
```

###title
Changes the page title. Default is 'mongooseadmin'.

*authentication* - A function that takes the parameters username, password and callback.
The callback expects to receive a boolean value for if the username and password is valid. Example
```
var options = {
    authentication:
        function (username, password, callback) {
            callback(username == 'johndoe' && password == '<PASSWORD>');
        }
    };
```

###css
Add your own css file. Example:
```
var options = {
    css: '/public/myown.css'
    };
```

###js
Add your own javascript file. Example:
```
var options = {
    css: '/public/myown.js'
    };
```

###login
Add your own login url. Just add a FORM that post to your admin url with username and password. Example:
```
var options = {
    css: '/login'
    };
```
{'fraction_non_alphanumeric': 0.1395109395109395, 'fraction_numerical': 0.0015444015444015444, 'mean_word_length': 3.371203599550056, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5226797', 'n_tokens_mistral': 1155, 'n_tokens_neox': 1118, 'n_words': 422}