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.
-
Clone the repository
-
Install the dependencies:
cd apollo-hapi-upload npm install # ...
Running
This project contains a demo UI built with Semantic UI. To run it locally:
-
Build:
npm run build
-
Start the server:
npm start
-
Open localhost:3000
Tests
This project includes a basic lab test. To run it:
-
Build the server:
npm run build:server
-
Run the test:
npm test