Skip to content

martiendt/test-boilerplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

d1d88b3 · Nov 3, 2023

History

72 Commits
Aug 8, 2021
Nov 25, 2021
Nov 19, 2021
Sep 23, 2021
Sep 18, 2021
Oct 4, 2021
Oct 4, 2021
Oct 1, 2021
Sep 3, 2021
Aug 9, 2021
Nov 3, 2023
Sep 23, 2021
Sep 23, 2021
Sep 3, 2021
Nov 25, 2021
Oct 3, 2021

Repository files navigation

Express API Boilerplate

Logo

<script setup lang="ts">
  import { BaseComponent } from '@point-hub/vue-library-starter'
</script>

<template>
  <div>
    <component
      :is="BaseComponent"
      title="Hello World"
      description="Lorem ipsumLorem ipsum dolor sit amet, consectetur adipiscing elit."
    ></component>
  </div>
</template>
<script setup lang="ts">
  import { BaseComponent } from '@point-hub/vue-library-starter'
</script>

<template>
  <div>
    <component
      :is="BaseComponent"
      title="Hello World"
      description="Lorem ipsumLorem ipsum dolor sit amet, consectetur adipiscing elit."
    ></component>
  </div>
</template>

Overview

This is a boilerplate application for building REST APIs in Node.js using ES6 and Express. Helps you stay productive by following best practices.

Features

Directory Structure

•
├── config
│   └── auth.js
│   └── database.js
│   └── environment.js
│   └── mail.js
│   └── server.js
├── database
│   └── connection.js
├── middleware
│   └── error-handler
│   └── validation
├── modules
│   └── <module>
│       └── controller
│       │   └── index.js
│       │   └── create.js
│       │   └── read-all.js
│       │   └── read-one.js
│       │   └── update.js
│       │   └── destroy.js
│       └── middleware
│       └── policy
│       │   └── index.js
│       │   └── create.js
│       │   └── read-all.js
│       │   └── read-one.js
│       │   └── update.js
│       │   └── destroy.js
│       └── rules
│       │   └── create.js
│       │   └── update.js
│       │   └── destroy.js
│       └── service
│       │   └── <module>.service.js
│       └── test
│       └── model.js
│       └── schema.js
│       └── seed.js
│       └── router.js
├── utils
│   └── logger
│   └── mailer
│   └── response-format
├── app.js
├── router.js
└── server.js

Getting Started

...

Installation

...

Quick Start

...

Testing Email

When building complex applications then sooner or later you end up in a situation where you need to send emails from your application in test environment but do not want to accidentally spam anyone.

One solution would be to separate development email addresses and use only some specific testing address to send all mail to but a better approach would be to use a separate email catching service that accepts all messages like a normal transactional SMTP service would but instead of delivering these to destination, it only logs these messages.

There are several options for using such a service, Nodemailer has built-in support for Ethereal Email. You can create new testing account on the fly by using the createTestAccount method or from the Ethereal homepage.

Reference Links:

https://nodemailer.com/smtp/testing/

https://ethereal.email/