Skip to content

GlobalDigitalLibraryio/api-documentation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GDL api-documentation

Security

The api-documentation is open for all, but some endpoints are secured with OAuth2 through Auth0. To get access, click the Authorize-button and log in. Then send an email to [email protected] and request access.

Development

Requirements

  • Node.JS ~6.2
  • npm ~3.9
  • Docker (optional)

Getting started

What's in the box?

  • Express
  • Babel (ES6)

Dependencies

All dependencies are defined in package.json and are managed with npm. To initially install all dependencies and when the list dependency has changed, run npm install.

$ npm install

Start development server

Start node server with hot reloading middleware listening on port 3001.

$ npm start

To use a different api set the GDL_API_URL environment variable.

Unit tests

Test framework: ava with enzyme.

$ npm test

Do you tdd?

$ npm run tdd

Code style

tl;dr: Use eslint! Rules: [Airbnb Styleguide]https://github.com/airbnb/javascript.

Lint code with eslint, including eslint react plugin, eslint-plugin-import, eslint-plugin-jsx-a11y. Beside linting with globally installed eslint, eslint can be invoked with npm:

$ npm run lint

Rules are configured in ./.eslintrc.js and extends eslint-config-airbnb. If feeling brave, try eslint --fix.

Other scripts

# Run with NODE_ENV=production:
$ npm run start-prod
# Docker stuff
$ ./build.sh

Dependencies

Please update this section if you add or remove dependencies. Hint: Running npm ls --long --depth 0 prints a list of dependencies including a brief description.

Server

express: Fast, unopinionated, minimalist web framework http://expressjs.com/

nodemon: Simple monitor script for use during development of a node.js app. http://nodemon.io

compression Node.js compression middleware https://github.com/expressjs/compression#readme

cors Middleware for dynamically or statically enabling CORS in express/connect applications https://github.com/expressjs/cors/

Util

defined: return the first argument that is !== undefined. https://github.com/substack/defined

lodash: Lodash modular utilities. https://lodash.com/

cross-env Run commands that set environment variables across platforms https://github.com/kentcdodds/cross-env

parse5 WHATWG HTML5 specification-compliant, fast and ready for production HTML parsing/serialization toolset for Node.js https://github.com/inikulin/parse5

ES2015/6

babel-register: babel require hook https://babeljs.io/

babel-preset-es2015: Babel preset for all ES2015 plugins. https://babeljs.io/

babel-polyfill: Polyfill for a full ES2015 environment https://babeljs.io/

babel-preset-react: Babel preset for all React plugins. https://babeljs.io/

babel-plugin-transform-object-rest-spread: Compile object rest and spread to ES5 https://babeljs.io/

babel-plugin-transform-async-to-generator Turn async functions into ES2015 generators https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-async-to-generator

isomorphic-fetch: Isomorphic WHATWG Fetch API, for Node & Browserify. https://github.com/matthew-andrews/isomorphic-fetch/issues

Testing

ava Futuristic test runner 🚀 git+https://github.com/avajs/ava.git

Code style

eslint: An AST-based pattern checker for JavaScript. http://eslint.org

babel-eslint Custom parser for ESLint https://github.com/babel/babel-eslint

eslint-plugin-babel An eslint rule plugin companion to babel-eslint https://github.com/babel/eslint-plugin-babel#readme

eslint-config-airbnb: Airbnb's ESLint config, following their styleguide https://github.com/airbnb/javascript

eslint-plugin-import: Import with sanity. https://github.com/benmosher/eslint-plugin-import

eslint-plugin-jsx-a11y: A static analysis linter of jsx and their accessibility with screen readers. https://github.com/evcohen/eslint-plugin-jsx-a11y#readme

eslint-plugin-react: React specific linting rules for ESLint. https://github.com/yannickcr/eslint-plugin-react

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •