Loading episodes…
0:00 0:00

Setting up Angular 14 Node authentication backend

00:00
BACK TO HOME

Setting up Angular 14 Node authentication backend

10xTeam October 19, 2022 2 min read

In this step, we’ll clone the Node authentication backend from GitHub and run it locally.

Head back to a new command-line interface and run the following command:

$ git clone https://github.com/techiediaries/node-mongodb-jwt-authentication.git node-mongodb-authentication-backend

Next, navigate to the project’s folder and install the dependencies then start the server as follows:

$ cd node-mongodb-authentication-backend
$ npm install
$ npm start

The Node server will be available from http://localhost:4000/.

Next, you also need to run the mongod client. Open a new command-line interface and run:

$ mongod

These are the API endpoints that are exposed from the Node server:

  • POST /users/login
  • POST /users/register
  • GET /users/profile/id
  • PUT /users/update/id
  • DELETE /users/delete/id

Step 5 - Setting up Angular 14 HttpClient

In this step we’ll import and set up HttpClient in our Angular project.

Open the src/app/app.module.ts file, import HttpClientModule and add it the imports array as follows:

import { HttpClientModule } from '@angular/common/http';

@NgModule({
  imports: [
    HttpClientModule
   ]
})

See you in the next tutorial


Join the 10xdev Community

Subscribe and get 8+ free PDFs that contain detailed roadmaps with recommended learning periods for each programming language or field, along with links to free resources such as books, YouTube tutorials, and courses with certificates.

Audio Interrupted

We lost the audio stream. Retry with shorter sentences?