Skip to content

Bump npm-registry-fetch from 4.0.2 to 4.0.5 #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 27 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,43 @@
# Angular 8 Spring Boot JWT Authentication example

> [Angular 8 + Spring Boot: JWT Authentication example](https://bezkoder.com/angular-spring-boot-jwt-auth/)

# Angular 8 JWT Authentication example

For more detail, please visit:
> [Angular 8 JWT Authentication with HttpInterceptor and Router](https://bezkoder.com/angular-jwt-authentication/)

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 8.3.21.

## Development server
## With Spring Boot back-end

Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
> [Angular 8 + Spring Boot: JWT Authentication & Authorization example](https://bezkoder.com/angular-spring-boot-jwt-auth/)

## Code scaffolding
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`.

Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
## With Node.js Express back-end

## Build
> [Node.js Express + Angular 8: JWT Authentication & Authorization example](https://bezkoder.com/node-js-express-angular-jwt-auth/)

Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.
Open `app/_helpers/auth.interceptor.js`, modify the code to work with **x-access-token** like this:
```js
...

## Running unit tests
// const TOKEN_HEADER_KEY = 'Authorization'; // for Spring Boot back-end
const TOKEN_HEADER_KEY = 'x-access-token'; // for Node.js Express back-end

Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
@Injectable()
export class AuthInterceptor implements HttpInterceptor {
...

## Running end-to-end tests
intercept(req: HttpRequest<any>, next: HttpHandler) {
...
if (token != null) {
// for Spring Boot back-end
// authReq = req.clone({ headers: req.headers.set(TOKEN_HEADER_KEY, 'Bearer ' + token) });

Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
// for Node.js Express back-end
authReq = req.clone({ headers: req.headers.set(TOKEN_HEADER_KEY, token) });
}
return next.handle(authReq);
}
}

## Further help
...
```

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
Run `ng serve --port 8081` for a dev server. Navigate to `http://localhost:8081/`.
Loading