evenchange4 / Micro Medium Api
Licence: mit
Microservice for fetching the latest posts of Medium with GraphQL.
Stars: ✭ 138
Programming Languages
javascript
184084 projects - #8 most used programming language
Projects that are alternatives of or similar to Micro Medium Api
Micro Proxy
[DEPRECATED] Simplest proxy server for microservices
Stars: ✭ 358 (+159.42%)
Mutual labels: microservice, now, zeit
now-course
Proyecto para el curso de Now.sh en Platzi
Stars: ✭ 19 (-86.23%)
Mutual labels: now, zeit, apollo-server
Micro
Asynchronous HTTP microservices
Stars: ✭ 9,987 (+7136.96%)
Mutual labels: microservice, zeit, micro
Micro Router
🚉 A tiny and functional router for Zeit's Micro
Stars: ✭ 621 (+350%)
Mutual labels: microservice, zeit, micro
Now Logs
realtime logging for now - https://logs.now.sh
Stars: ✭ 103 (-25.36%)
Mutual labels: now, zeit
Micro Jwt Auth
jwt authorization wrapper for https://github.com/zeit/micro
Stars: ✭ 97 (-29.71%)
Mutual labels: microservice, micro
Sapper Firebase Typescript Graphql Tailwindcss Actions Template
A template that includes Sapper for Svelte, Firebase functions and hosting, TypeScript and TypeGraphQL, Tailwind CSS, ESLint, and automatic building and deployment with GitHub Actions
Stars: ✭ 111 (-19.57%)
Mutual labels: graphql, apollo-server
Api
🚀 GraphQL & REST APIs to explore all the rockets, launches & other SpaceX's data
Stars: ✭ 123 (-10.87%)
Mutual labels: graphql, apollo-server
Type Graphql Dataloader
TypeGraphQL + DataLoader + TypeORM made easy
Stars: ✭ 73 (-47.1%)
Mutual labels: graphql, apollo-server
Create React App Now
Hello, create-react-app, meet Zeit's awesome now.sh service.
Stars: ✭ 137 (-0.72%)
Mutual labels: now, zeit
Now Storage
Use Now static deployments to upload and store files.
Stars: ✭ 91 (-34.06%)
Mutual labels: now, zeit
Sapper Typescript Graphql Template
A template that includes Sapper for Svelte, TypeScript preprocessing, and a GraphQL server through TypeGraphQL
Stars: ✭ 84 (-39.13%)
Mutual labels: graphql, apollo-server
React Hipstaplate
A ReactJS full-stack boilerplate based on typescript with ssr, custom apollo-server and huge stack of modern utilities which will help you to start your own project
Stars: ✭ 74 (-46.38%)
Mutual labels: graphql, apollo-server
Micro Jaymock
Tiny API mocking microservice for generating fake JSON data.
Stars: ✭ 123 (-10.87%)
Mutual labels: microservice, micro
Awesome Apollo Graphql
A curated list of amazingly awesome things regarding Apollo GraphQL ecosystem 🌟
Stars: ✭ 126 (-8.7%)
Mutual labels: graphql, apollo-server
Next Advanced Apollo Starter
Advanced, but minimalistic Next.js pre-configured starter with focus on DX
Stars: ✭ 131 (-5.07%)
Mutual labels: graphql, zeit
Nextjs Vercel Firebase
Next.js app using API routes to connect with Firestore.
Stars: ✭ 133 (-3.62%)
Mutual labels: now, zeit
Graphql Microservices
Showcasing a graphql microservice setup
Stars: ✭ 68 (-50.72%)
Mutual labels: graphql, microservice
Micro-medium-api
Microservice for fetching the latest posts of Medium with GraphQL.
Further reading: [中文] Microservice 產品交付 - Dockerize 與 Zeit JavaScript 跨平台解決方案
Feature
- Use GraphQL.
- Dataloader for per-request memory cache.
- Rate-limiting 1 requests per sec.
How To Use
a. Deploy to Now.sh
One click deploys to △ now
b. Binary executable
Download from GitHub latest release.
$ ORIGIN=$YOUR_DOMAIN \
./micro-medium-api-macos --port $PORT
Note: You can run it without Node.js installed.
c. Docker image
Pull from dockerhub.
$ docker pull evenchange4/micro-medium-api:latest
$ docker run --rm -it \
-p $PORT:3000 \
-e "ORIGIN=YOUR_DOMAIN" \
evenchange4/micro-medium-api:latest
d. NPM CLI
Install from npm.
$ npm i micro-medium-api -g
$ ORIGIN=$YOUR_DOMAIN \
micro-medium-api --port $PORT
Note: You should use Node.js >= 8 .
API
Environment variables
ENV | Required | Default | Description |
---|---|---|---|
ORIGIN |
* |
Setup access-control-allow-origin for CORS. |
CLI arguments
$ micro-medium-api --help
Usage: micro-medium-api <command> [options]
Options:
-p, --port HTTP server PORT [default: 3000]
-h, --help Show help [boolean]
-v, --version Show version number [boolean]
GraphQL endpoint
- [GET] /graphql
- [POST] /graphql
Demo
- GraphiQL
- HTTP GET example
- Real-World case: michaelhsu.tw [source code]
Note: You should deploy your own service for production usage.
Technology Stacks
- 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
Developer Guide
Requirements
- 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
Test
$ yarn run format
$ yarn run eslint
$ yarn run test:watch
Docker
$ docker build -t micro-medium-api .
# Push to dockerhub
$ git push
Note: Multi-stage builds are a new feature in Docker 17.05.
Github release / NPM release
$ npm version patch
$ git push
Inspiration
CONTRIBUTING
- ⇄ 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
).
CHANGELOG
LICENSE
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].