An opinionated API template for Node.js backends
Extracted from apps I've built in the past
$ git clone email@example.com:joshbeitler/node-api-seed.git node-api-seed $ cd node-api-seed $ yarn
Before you dive into building out your API, it is important to set up the seed's required configuration values.
Apps built with this API seed can load sensitive config values from an environment file. An example is provided as
.env.example. To get started, rename or copy the example and modify your
.env file to meet your needs.
$ cp .env.example .env
You'll notice there are some default values in the example
.env - these are the default values used by both the server and the database. If you just leave it as is the app will run just fine, but I highly recommend replacing them with more secure credentials.
Additionally, there is a
config.js file located in the
lib/config folder that can be used to store non-sensitive values, such as the API root. Go ahead and check that out as well, but the defaults are sensible and don't nessesarily need to be changed.
$ docker-compose up
- based on koa
- [-] easy to develop for (nodemon, yarn, babel, etc)
- docker and docker-compose support
- pre-built auth and scope middleware
- database connection - sequelize
- eslint for standard.js
- ready for tests and CI runners
- a nice collection of pre-installed middleware
- koa-force-ssl ?
- koa-passport ?
- koa-jwt ?
- easy to configure
- support for .env files
- easy to deploy
- nice command line to generate resources
- [-] Paw document for prototyping API
Copyright 2017 Joshua Beitler Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.