当前位置: 首页 > 软件库 > Web应用开发 > Web框架 >

back-boilerplate

授权协议 Readme
开发语言 JavaScript
所属分类 Web应用开发、 Web框架
软件类型 开源软件
地区 不详
投 递 者 侯英达
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

Node API boilerplate by nave.rs

A boilerplate for building RESTful APIs using Node.js, PostgreSQL, koa, knex, objection.

Getting started

Installation

  1. Install Node.JS LTS version
  2. Install PostgreSQL
  3. Clone this repository and enter on the respective folder
  4. Install dependencies running: yarn or npm install

Things to do before run the project:

  1. Create database (by follow the commands):
  • CREATE USER user WITH PASSWORD password
  • CREATE DATABASE database
  • GRANT ALL PRIVILEGES ON DATABASE database to user
  1. Install citext extension on your database with the command CREATE EXTENSION citext;

  2. Change name value of .env.example to .env and set the key SECRET to any value you wish

  3. Change DATABASE_URL to postgress://user:password@localhost/database

  4. Run migrations: yarn db:migrate

  5. Run seeds: yarn db:seed

  6. Install Docker

  • Pull redis: docker pull redis
  • Create image: docker run --name your-image-name -d redis
  • Start redis: docker start your-image-name
  1. Run yarn start or yarn dev to start server

Testing

  1. Run tests: yarn test

Directory Structure

├── /src
|   ├── /controllers
|   ├── /database
|   |    ├── /migrations
|   |    ├── /seeds
|   ├── /helpers
|   ├── /middleware
|   ├── /models
|   ├── /routes
|   ├── /validators
├── /test

Postman

Run in Postman

Styleguide

Nodemailer

To use the nodemailer helper in a non-production environment, you need to set the variable in .env ALLOW_LIST and assign an array with the domains allowed for sending e-mail. This domain must start with an @, followed by a minimum of 2 characters, a . and 2 characters in the end.In case the informed email is not part of any informed domain, the email will not be sent.

Examples:

The following domains: nave.rs and@nave are not allowed as they do not satisfy the domain description, given above.

Database

This project uses objection.js as ORM and knex as query builder.

Migrations:

In order not to use before update hooks on our models, we decided to create a function and trigger via migration, everytime you create a table with updated_at add the trigger to it. (an example is in the file: "src/database/migrations/20180910221504_init.js")

Steps to use Queue UI

  1. After adding a new queue, need to add in queue.js a new adapter
  2. Acess UI on http://localhost:3001/v1/queues/dashboards
 相关资料
  • taiga 是一个项目管理平台,它为做敏捷开发的程序员,设计师及项目管理员提供了界面漂亮且功能强大的工具。taiga 可以方便地任你定制所有项目,操作直观简单,界面漂亮,可个性地定制每个项目。 taiga-back 是用来管理 scrum 项目的 web应用程序,它采用了 Django 和 AngularJS 框架 (后端代码)。

  • 当你从一个页面切换到另一个页面时,app.js将会有一段你曾经拥有的页面的历史,能够导航到它们。返回是应用程序的概念上的反转,加载在导航栏中返回到前一个页面加载(当导航完成时破坏当前页面)。 // load home // load page2 App.back(function () { // back to home // page2's appDestroy event has be

  • 想要备份你的 Linux 系统吗?或许 Back In Time 就是为你而准备的工具。Back In Time 使用起来很简单,它从 FlyBack 和 TimeVault 身上获得了开发灵感,支持 Snapshot(快照式)备份,能够设定备份计划,让你在指定的时间完成系统备份,并提供有 GNOME 和 KDE 4 界面。 Back In Time 为你准备了 Ubuntu 和 Fedora 源

  • 实现新视图弹出时,之前的视图变淡、缩小(即后退为背景视图)的动画效果。 [Code4App.com]

  • 自定义导航条上面返回按钮(backbutton)的文字和颜色,以及自定义导航条的颜色和图片。 [Code4App.com]

  • 本文向大家介绍Go-Back-N ARQ,包括了Go-Back-N ARQ的使用技巧和注意事项,需要的朋友参考一下 Go-Back-N自动重复请求(Go-Back-N ARQ)是一种数据链路层协议,它使用滑动窗口方法来可靠且顺序地传递数据帧。在滑动窗口协议的情况下,发送窗口大小为N,接收窗口大小为1。 工作原则 Go – Back – N ARQ使用协议流水线的概念,即在接收到第一个帧的确认之前发