# logan-api

> Logan API is a minimal rest API library for projects in Express, Typescript and Mongoose.

Latest version **0.1.21** (published 2021-07-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install logan-api
pnpm add logan-api
yarn add logan-api
bun add logan-api
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.21 |
| Published | 2021-07-31 |
| First published | 2021-06-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=10 |
| Dependencies | 10 |
| Unpacked size | 319.1 KB |
| Known vulnerabilities | 0 (+6 in 2 direct dependencies) |
| Install scripts | no |
| Author | Thiago Pacheco |
| Maintainers | thisk8brd |

## Links

- npm: https://www.npmjs.com/package/logan-api
- npm.io page: https://npm.io/package/logan-api

## Dependencies (10)

- [oauth](https://npm.io/package/oauth.md) ^0.9.15
- [bcrypt](https://npm.io/package/bcrypt.md) ^5.0.1
- [dotenv](https://npm.io/package/dotenv.md) ^10.0.0
- [express](https://npm.io/package/express.md) ^4.17.1
- [slugify](https://npm.io/package/slugify.md) ^1.5.3
- [mongoose](https://npm.io/package/mongoose.md) ^5.12.12
- [jsonwebtoken](https://npm.io/package/jsonwebtoken.md) ^8.5.1
- [mongoose-seed](https://npm.io/package/mongoose-seed.md) ^0.6.0
- [express-session](https://npm.io/package/express-session.md) ^1.17.2
- [express-fileupload](https://npm.io/package/express-fileupload.md) ^1.2.1

## Recent versions

- 0.1.21 (latest) — 2021-07-31
- 0.1.20 — 2021-06-19
- 0.1.19 — 2021-06-16
- 0.1.18 — 2021-06-15
- 0.1.17 — 2021-06-15

## README

# Logan API

Logan API is a minimal rest API library for projects in Express, Typescript and Mongoose.

## Installation

Use the package manager [npm](https://www.npmjs.com/get-npm) to install Logan.

```bash
npm install --save logan
```
or
```
yarn add logan
```

## Usage

```typescript
import { Server } from '@pachecoio/logan'

const server = new Server();

@server.get('/')
function hello(req: Request) {
  return 'hello';
}

server.start();

```

## Database connection

To connect with a Mongo Database, it is as simple as having a running instance of MongoDB ready and updating the url under the `.env` file

```
# .env
MONGODB_URI=<YOUR MONGODB URI>
...
```


## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.


## License
[MIT](https://choosealicense.com/licenses/mit/)

<!-- # TSDX User Guide

Congrats! You just saved yourself hours of work by bootstrapping this project with TSDX. Let’s get you oriented with what’s here and how to use it.

> This TSDX setup is meant for developing libraries (not apps!) that can be published to NPM. If you’re looking to build a Node app, you could use `ts-node-dev`, plain `ts-node`, or simple `tsc`.

> If you’re new to TypeScript, checkout [this handy cheatsheet](https://devhints.io/typescript)

## Commands

TSDX scaffolds your new library inside `/src`.

To run TSDX, use:

```bash
npm start # or yarn start
```

This builds to `/dist` and runs the project in watch mode so any edits you save inside `src` causes a rebuild to `/dist`.

To do a one-off build, use `npm run build` or `yarn build`.

To run tests, use `npm test` or `yarn test`.

## Configuration

Code quality is set up for you with `prettier`, `husky`, and `lint-staged`. Adjust the respective fields in `package.json` accordingly.

### Jest

Jest tests are set up to run with `npm test` or `yarn test`.

### Bundle Analysis

[`size-limit`](https://github.com/ai/size-limit) is set up to calculate the real cost of your library with `npm run size` and visualize the bundle with `npm run analyze`.

#### Setup Files

This is the folder structure we set up for you:

```txt
/src
  index.tsx       # EDIT THIS
/test
  blah.test.tsx   # EDIT THIS
.gitignore
package.json
README.md         # EDIT THIS
tsconfig.json
```

### Rollup

TSDX uses [Rollup](https://rollupjs.org) as a bundler and generates multiple rollup configs for various module formats and build settings. See [Optimizations](#optimizations) for details.

### TypeScript

`tsconfig.json` is set up to interpret `dom` and `esnext` types, as well as `react` for `jsx`. Adjust according to your needs.

## Continuous Integration

### GitHub Actions

Two actions are added by default:

- `main` which installs deps w/ cache, lints, tests, and builds on all pushes against a Node and OS matrix
- `size` which comments cost comparison of your library on every pull request using [`size-limit`](https://github.com/ai/size-limit)

## Optimizations

Please see the main `tsdx` [optimizations docs](https://github.com/palmerhq/tsdx#optimizations). In particular, know that you can take advantage of development-only optimizations:

```js
// ./types/index.d.ts
declare var __DEV__: boolean;

// inside your code...
if (__DEV__) {
  console.log('foo');
}
```

You can also choose to install and use [invariant](https://github.com/palmerhq/tsdx#invariant) and [warning](https://github.com/palmerhq/tsdx#warning) functions.

## Module Formats

CJS, ESModules, and UMD module formats are supported.

The appropriate paths are configured in `package.json` and `dist/index.js` accordingly. Please report if any issues are found.

## Named Exports

Per Palmer Group guidelines, [always use named exports.](https://github.com/palmerhq/typescript#exports) Code split inside your React app instead of your React library.

## Including Styles

There are many ways to ship styles, including with CSS-in-JS. TSDX has no opinion on this, configure how you like.

For vanilla CSS, you can include it at the root directory and add it to the `files` section in your `package.json`, so that it can be imported separately by your users and run through their bundler's loader.

## Publishing to NPM

We recommend using [np](https://github.com/sindresorhus/np).
"# logan"  -->

---
_Source: https://npm.io/package/logan-api · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
