/apollo-hapi-upload

File uploads with Apollo + hapi

Primary LanguageTypeScriptApache License 2.0Apache-2.0

apollo-hapi-upload

File uploads with Apollo + hapi

This project tests Apollo Server's file uploads with hapi and apollo-upload-client.

Purpose

This repository is a smoke test for apollo-server-hapi's file upload feature. It confirms that something is broken:

npm run build:server
# ...
npm test
# ...
Failed tests:

  1) file uploads:

      actual expected

      400200

      Expected 400 to equal specified value: 200

      at /Users/creed/dev/apollo-hapi-upload/test/server.js:38:46


1 of 1 tests failed
Test duration: 65 ms
# ...

The server's response:

{
    "statusCode": 400,
    "error": "Bad Request",
    "message": "GET query missing."
}

Setup

Ensure you have Node.js v10.x.x.

  1. Clone the repository

  2. Install the dependencies:

    cd apollo-hapi-upload
    npm install
    # ...
    

Running

This project contains a demo UI built with Semantic UI. To run it locally:

  1. Build:

    npm run build
  2. Start the server:

    npm start
  3. Open localhost:3000

Tests

This project includes a basic lab test. To run it:

  1. Build the server:

    npm run build:server
  2. Run the test:

    npm test