Code Monkey home page Code Monkey logo

express-mongoose-template's Introduction

express-mongoose-template

Quick Start

Get started developing...

You need to create a .env file and configure your database at first, then set up the database and start developing / testing.

# install deps
yarn install

# run in development mode
yarn dev

# run tests
yarn test

# check code styles
yarn lint

# check type errors
yarn typecheck

Install Dependencies

Install all package dependencies (one time operation)

yarn install

Run It

Run in development mode:

Runs the application is development mode. Should not be used in production

yarn dev

or debug it

yarn dev:debug

Run in production mode:

Compiles the application and starts it in production mode

yarn compile
yarn start

Test It

Run the Mocha unit tests

yarn test

or debug them

yarn test:debug

Run the tests and output a JUnit-style XML test results file at ./test/test-results.xml

yarn test:junit

Try It

Make sure the database is running

  • Open you're browser to http://localhost:3000
  • Invoke the /examples endpoint
    curl http://localhost:3000/api/v1/examples

Debug It

Debug the server:

yarn dev:debug

Debug Tests

yarn test:debug

Debug with VSCode

Use the configurations in .vscode/launch.json file

Lint It

Check types and fix all linter errors

Check code styles

yarn lint
yarn lint:fix  # fix linter errors as well

Check type error

yarn typecheck

About

This template project was originally generated by cdimascio/generator-express-no-stress-typescript, and added with mongoose and several DevOps tools (Dependabot and GitHub Actions).

What you get!

  • Typescript - Typescript is a typed superset of JavaScript that compiles to plain JavaScript
  • Express.js - Fast, unopinionated, minimalist web framework for Node.js
  • Mongoose - Mongoose is a MongoDB object modeling tool designed to work in an asynchronous environment.
  • Pino - Extremely fast node.js logger, inspired by Bunyan. It also includes a shell utility to pretty-print its log files
  • dotenv - Loads environment variables from .env for nodejs projects
  • Swagger - is a simple yet powerful representation of your RESTful API.
  • SwaggerUI - dynamically generate beautiful documentation and sandbox from a Swagger-compliant API
  • express-openapi-validator - An OpenApi validator for ExpressJS that automatically validates API requests using an OpenAPI 3.x specification

More information here

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.