node-expressx
v1.1.14
Published
ExpressX is a default server setup with Node Express and MongoDB support. Follow instruction and documentation to Save your 10x time.
Downloads
495
Maintainers
Readme
Node Express Server Setup
Installation Process
Tuitorial: https://youtu.be/NLvC-JCFJAA?si=CcXtaGkJ6QQ9jOqN Or you can follow these steps:
- Run the following command
npx node-expressx
- Create a new database in MongoDB Compass or MongoDB Cloud Storage
- Then at the root rename
example.env
to.env
, Open this file and findDATABASE_URL
, Default name givennextjs
change it whatever you want. - You can add local(just give database name) and also cloud for production level(need username and password and database name)
- Goto this project directory & open
two
terminal
npx tsc --w
npm start
- Now project will run in following port
http://localhost:5000
- Inserting new user to database
- You can open
postman
or any api testing tools and paste this api endpoint into the url section. Method POST
http://localhost:5000/api/v1/users
- After that select
body
and alsojson
as format and paste that object, usedbcrypt
to encrypt password
{ "username": "Minhazul Abedin Munna", "email": "[email protected]", "password": "1234", "role": "admin" }
- Now select
POST
method and hitsend
button, It will successfully create a user.
- You can open
API Endpoints
- Home route:
http://localhost:5000
- Fetch all users route:
http://localhost:5000/api/v1/users
Thank you
2024© Developed by smmunna