- Notifications
You must be signed in to change notification settings - Fork18
Microservice for fetching the latest posts of Medium with GraphQL.
License
NotificationsYou must be signed in to change notification settings
evenchange4/micro-medium-api
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Microservice for fetching the latest posts of Medium with GraphQL.
Further reading:[中文] Microservice 產品交付 - Dockerize 與 Zeit JavaScript 跨平台解決方案
- Use GraphQL.
- Dataloader for per-request memory cache.
- Rate-limiting 1 requests per sec.
One click deploys to △ now
Download from GitHublatest release.
$ ORIGIN=$YOUR_DOMAIN \ ./micro-medium-api-macos --port $PORTNote: You can run it without Node.js installed.
Pull fromdockerhub.
$ docker pull evenchange4/micro-medium-api:latest$ docker run --rm -it \ -p $PORT:3000 \ -e "ORIGIN=YOUR_DOMAIN" \ evenchange4/micro-medium-api:latestInstall fromnpm.
$ npm i micro-medium-api -g $ ORIGIN=$YOUR_DOMAIN \ micro-medium-api --port $PORTNote: You should use Node.js >= 8 .
| ENV | Required | Default | Description |
|---|---|---|---|
ORIGIN | * | Setupaccess-control-allow-origin for CORS. |
$ micro-medium-api --helpUsage: micro-medium-api <command> [options] Options: -p, --port HTTP server PORT [default: 3000] -h, --help Show help [boolean] -v, --version Show version number [boolean]- [GET] /graphql
- [POST] /graphql
- GraphiQL
- HTTP GET example
- Real-World case:michaelhsu.tw [source code]
Note: You should deploy your own service for production usage.
- Micro: Asynchronous HTTP microservices.
- Micro-router: A tiny and functional router for Zeit's Micro.
- Micro-ratelimit: Rate-limiting middleware for micro.
- Graphql-tools: 🔧 Build and mock your GraphQL.js schema using the schema language.
- Graphql-server-micro: 🌍 GraphQL server
- Dataloader: DataLoader is a generic utility to be used as part of your application's data fetching layer to provide a consistent API over various backends and reduce requests to those backends via batching and caching.
- Dockerhub: Automatically deploy docker image.
- Now.sh: Realtime global deployments
- Pkg: Package your Node.js project into an executable
- Travis: CI
- node >= 8.5.0
- npm >= 5.3.0
- yarn >= 1.0.2
$ git clone https://github.com/evenchange4/micro-medium-api.git$ yarn install --pure-lockfile$ yarn run dev # dev server$ yarn start # prod server$ yarn run pkg # output binary files$ yarn run format$ yarn run eslint$ yarn run test:watch$ docker build -t micro-medium-api .# Push to dockerhub$ git pushNote: Multi-stage builds are a new feature in Docker 17.05.
$ npm version patch$ git push- ⇄ Pull requests and ★ Stars are always welcome.
- For bugs and feature requests, please create an issue.
- Pull requests must be accompanied by passing automated tests (
$ yarn run test).
About
Microservice for fetching the latest posts of Medium with GraphQL.
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.