npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

express-restful-starter

v0.0.3

Published

This is a starter kit for building RESTful APIs with ES6, Express framework and Passport

Downloads

2

Readme

Express RESTful Starter

This is a starter kit for building RESTful APIs with ES6, Express framework and Passport

Getting started

# Clone the repository
git clone [email protected]:nutboltu/express-restful-starter.git
cd express-restful-starter

# Remove this git config
rm -rf .git 

# Install dependencies
npm i

# Start server in development environment
npm start

# Start server in production environment
npm start:prod

The api service runs on port 3000. We implemented following apis in this starter kit

BASE_PATH: http://localhost:3000/api/

Authentication
    POST    /login
            Request:
                body:{
                    username: // for mock-data farhad.yasir
                    password: // for mock-data 123456
                }
            Response:
            {
                user: // a demo user info
            }
Users **You must be loggedIn before calling these apis**
    POST    /users
            Request:
                body:{
                    firstName: user's first name,
                    lastName: user's last name,
                    email: user's email,
                    password: user's password,
                }
            Response:
            {
                // returns same body for now. You need to update code in
                // /models/handlers/user.model.handlers.js
                firstName: user's first name,
                lastName: user's last name,
                email: user's email,
                password: user's password,
            }
    PUT     /users/:id
            Response:
            {
                // returns same body for now. You need to update code in
                // /models/handlers/user.model.handlers.js
                firstName: user's first name,
                lastName: user's last name,
                email: user's email,
                password: user's password,
            }
    GET     /users/:offset/:limit
            Response:
            {
                // returns offset and limit for now. You need to update code in
                // /models/handlers/user.model.handlers.js
                offset: url's offset,
                limit: url's limit,
            }
    GET     /users/:id
            Response:
            {
                // returns id for now. You need to update code in
                // /models/handlers/user.model.handlers.js
               id
            }
    DELETE  /users/:id
            Response:
            {
                // returns id for now. You need to update code in
                // /models/handlers/user.model.handlers.js
               id
            }

Starter Kit Layout

+- config
|   +- env                    --> environment dependable configuration files
|     +- common.js            --> common configurations for all environment
|     +- development.js       --> configurations for development
|     +- production.js        --> configurations for production
|   +- index.js               --> configuration file where all configurations are concatenated
+- controllers                --> controller files
+- routes                     --> REST api routers
+- models                     --> models directories that communicate with the database
|   +- {Entity Name}          --> database access layer that connects with the db models
+- node_modules               --> development dependencies node modules
+- utilities                  --> utilities files
|   +- authentication         --> uses passport as authentication
|   +- constants              --> consists application constants
|   +- handlers               --> any kinds of handlers (e.g: errorHandler, responseHandler)
|   +- validators             --> customize express validators
+- server.js                  --> application run file
+- package.json               --> node package

Licence

MIT licence