# nHttpInterceptor

> [![Build Status](https://travis-ci.org/nodes-frontend/nHttpInterceptor.svg?branch=master)](https://travis-ci.org/nodes-frontend/nHttpInterceptor) [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg

Latest version **1.1.1** (published 2016-12-08) · 0 weekly downloads

## Install

```sh
npm install nHttpInterceptor
pnpm add nHttpInterceptor
yarn add nHttpInterceptor
bun add nHttpInterceptor
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2016-12-08 |
| First published | 2016-05-06 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.12.0 |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+13 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Tommy Jepsen |
| Maintainers | hafstad |

## Links

- npm: https://www.npmjs.com/package/nHttpInterceptor
- Repository: https://github.com/nodes-frontend/nHttpInterceptor
- Homepage: https://github.com/nodes-frontend/nHttpInterceptor#readme
- Issues: https://github.com/nodes-frontend/nHttpInterceptor/issues
- npm.io page: https://npm.io/package/nHttpInterceptor

## Dependencies (1)

- [angular](https://npm.io/package/angular.md) 1.5.2

## Recent versions

- 1.1.1 (latest) — 2016-12-08
- 1.1.0 — 2016-05-06
- 1.0.0 — 2016-05-06

## README

# Nodes http inceptor
[![Build Status](https://travis-ci.org/nodes-frontend/nHttpInterceptor.svg?branch=master)](https://travis-ci.org/nodes-frontend/nHttpInterceptor)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
[![Coverage Status](https://coveralls.io/repos/github/nodes-frontend/nHttpInterceptor/badge.svg?branch=master)](https://coveralls.io/github/nodes-frontend/nHttpInterceptor?branch=master)
[![devDependency Status](https://david-dm.org/nodes-frontend/nHttpInterceptor/dev-status.svg)](https://david-dm.org/nodes-frontend/nHttpInterceptor#info=devDependencies)
[![Dependency Status](https://david-dm.org/nodes-frontend/nHttpInterceptor.svg)](https://david-dm.org/nodes-frontend/nHttpInterceptor)

## Implement it in config.js

```javascript
(function () {
	'use strict';

	var core = angular.module('config', ['nHttpInceptor']);


	core.config(configure);

	/* @ngInject */
	function configure($httpProvider, nhttpinceptorProvider) {

		/* nhttpinceptor */

		// Set up the error messages custom
		// You can set error401 to a translate key, fx "errorRandomMsg". It will then output the translate key,
		// and if it does not exist, then it will output "errorRandomMsg"
		nhttpinceptorProvider.configure({
			error401: "Du har ikke adgang til dette."
		});

		//The inceptor
		$httpProvider.interceptors.push(function($q, nHttpInceptor) {
			return {
				responseError: function(res) {

					nHttpInceptor.errorHandle(res.status);

					return $q.reject(res);
				}
			};
		});
		/* nhttpinceptor */

	}

})();
```


## messages
Messages(nMessages) is a part of the Nodes Galactic core.

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