Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial docs #13

Merged
merged 1 commit into from
Jan 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ node_modules
!.yarn/releases
!.yarn/sdks
!.yarn/versions
/remix-google-cloud-functions/README.md
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,39 @@
# remix-google-cloud-functions

Google Cloud functions request handler for Remix.
[Remix](https://remix.run) [Adapter](https://remix.run/docs/en/v1/other-api/adapter) for [Google Cloud Functions](https://cloud.google.com/functions) and [Firebase Functions](https://firebase.google.com/docs/functions).

## Usage

### Firebase

See the [example project](./example/).

```sh
npm i remix-google-cloud-functions @remix-run/node @google-cloud/functions-framework firebase-functions
```

Create a Firebase function as follows - `build` should point to the output from `remix build` or `remix dev`.

```js
const { onRequest } = require("firebase-functions/v2/https");
const { createRequestHandler } = require("remix-google-cloud-functions");

const remix = onRequest(
createRequestHandler({
build: require("../build"),
})
);
module.exports = { remix };
```

### Google Cloud Functions

```sh
npm i remix-google-cloud-functions @remix-run/node @google-cloud/functions-framework
```

TBC. Refer to the Firebase example above or follow the [official guide](https://cloud.google.com/functions/docs/writing/write-http-functions)

## About Remix

[Remix](https://remix.run) is a web framework that helps you build better websites with React.
Expand Down
10 changes: 10 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
{
"private": true,
"description": "Remix Adapter for Google Cloud Functions and Firebase Functions",
"license": "MIT",
"author": "Alasdair McLeay",
"repository": {
"type": "git",
"url": "https://github.com/penx/remix-google-cloud-functions"
},
"bugs": {
"url": "https://github.com/penx/remix-google-cloud-functions/issues"
},
"packageManager": "yarn@3.3.1",
"workspaces": [
"example",
Expand Down
6 changes: 4 additions & 2 deletions remix-google-cloud-functions/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"name": "remix-google-cloud-functions",
"description": "Google Cloud functions request handler for Remix",
"description": "Remix Adapter for Google Cloud Functions and Firebase Functions",
"version": "0.0.3",
"license": "MIT",
"author": "Alasdair McLeay",
"main": "build/index.js",
"repository": {
"type": "git",
Expand All @@ -13,7 +14,8 @@
},
"scripts": {
"build": "rm -rf build && tsc -b",
"test": "jest"
"test": "jest",
"prepare": "cp ../README.md ./README.md"
},
"peerDependencies": {
"@google-cloud/functions-framework": "^3.1.1",
Expand Down