1.0.25 • Published 10 months ago

create-expressapi-boilerplate v1.0.25

Weekly downloads
-
License
ISC
Repository
github
Last release
10 months ago

thumbnail

create-expressapi-boilerplate is a boilerplate to launch your express project in seconds with a built-in authentication system.

First Step:

copy and paste this command into your terminal

npx create-expressapi-boilerplate@latest <project-name>

you replace project-name with the name you want

this is the result you will get

stepOne

Second Step:

then you will have a sub-folder with the name of your project in my case is "my-app", and you access it by using this command:

cd my-app

then open your code editor in my case is visual studio code:

code .

after opening vs code, your starter template will look like this:

setpTwo

Third Step:

Now you have to install the necessary dependencies by opening the integrated terminal in vs code and using this command

npm i

this is the expected result:

stepThird

then the project structure will look like this:

stepFourth

Fourth Step:

now in your root project folder create a file called "config.env" and paste into it this code

MONGODB_URI = mongodb+srv://username:password@cluster0.test.mongodb.net/test

SECRET_JWT = Gju!hWLSLPIN6%$5q1P1K7\*3qGoP6hdhhdehdhdhhdndbbebgygddhdehd
JWT_EXPIRES_IN = 1d
JWT_COOKIE_EXPIRES_IN = 1

the only variables you gonna change are MONGODB_URI and SECRET_JWT.

You have to change SECRET_JWT to another long string, the more complicated is it the more safe your authentication system is safe (Note: you have to make sure that no one has access to your SECRET_JWT )

you can get MONGODB_URI in your mongodb account, in order to get it you browse your project in Mongodb:

stepFifth

and click connect

stepSixth

choose the "VS code" option to get your connection string

Final Step:

enter this command

npm start

expected result:

finalStep

go to Postman to test your endpoints

login: http://localhost:5000/api/v1/users/login

login

signup: http://localhost:5000/api/v1/users/signup

signup

1.0.25

10 months ago

1.0.24

1 year ago

1.0.23

1 year ago

1.0.22

1 year ago

1.0.21

1 year ago

1.0.20

1 year ago

1.0.19

1 year ago

1.0.18

1 year ago

1.0.17

1 year ago

1.0.16

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago