Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Commit

Permalink
Update docs for deprecation
Browse files Browse the repository at this point in the history
- Mention the need to re-write mruby parts
- Link to a specific nginx build pack and give commands on how to add it
- Give specific command to remove this buildpack from app
- Mention in README we're open to extra docs/help for people migrating off.
- Space after testing header because it's my thing and I looked at those docs. 
- Added a link to where  `Nginx::Request` is defined because it's not obvious it comes from ngx_mruby
  • Loading branch information
schneems committed Jun 9, 2022
1 parent 90a7272 commit aca1489
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,16 @@ $ heroku run bash
~ $ cat config/nginx.conf
```

These commands will output your current NGINX config generated from your `static.json` contents. Write
these contents to your local repo, commit them to disk and configure an NGINX buildpack to
serve your application with that configuration.
These commands will output your current NGINX config generated from your `static.json` contents.

- Write these contents to your local repo at `config/nginx.conf.erb`, commit them to git.
- Replace path logic that previously used `mruby` with static logic.
- Configure your app to use the NGINX buildpack via `heroku buildpacks:add https://github.com/heroku/heroku-buildpack-nginx`.
- Remove this buildpack via `heroku buildpacks:remove https://github.com/heroku/heroku-buildpack-static`

## Deprecation PRs

If you have tips or tricks for migrating off of this buildpack and want to add them to the instructions above please send a PR.

## Features
* serving static assets
Expand Down Expand Up @@ -298,6 +305,7 @@ when accessing `/foo`, `X-Foo` will have the value `"foo"` and `X-Bar` will not
In case you have multiple buildpacks for the application you can ensure static rendering in `Procfile` with `web: bin/boot`.

## Testing

For testing we use Docker to replicate Heroku locally. You'll need to have [it setup locally](https://docs.docker.com/installation/). We're also using rspec for testing with Ruby. You'll need to have those setup and install those deps:

```sh
Expand Down
9 changes: 6 additions & 3 deletions bin/compile
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,12 @@ cat <<'EOF'
~ $ cat config/nginx.conf
```
These commands will output your current NGINX config generated from your `static.json` contents. Write
these contents to your local repo, commit them to disk and configure an NGINX buildpack to
serve your application with that configuration.
These commands will output your current NGINX config generated from your `static.json` contents.
- Write these contents to your local repo at `config/nginx.conf.erb`, commit them to git.
- Replace path logic that previously used `mruby` with static logic.
- Configure your app to use the NGINX buildpack via `heroku buildpacks:add https://github.com/heroku/heroku-buildpack-nginx`.
- Remove this buildpack via `heroku buildpacks:remove https://github.com/heroku/heroku-buildpack-static`
EOF

Expand Down
2 changes: 1 addition & 1 deletion scripts/config/lib/ngx_mruby/routes_path.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

config = {}
config = JSON.parse(File.read(USER_CONFIG)) if File.exist?(USER_CONFIG)
req = Nginx::Request.new
req = Nginx::Request.new # defined by https://github.com/matsumotory/ngx_mruby/blob/c7682cfb4c0984a41f1a447b71ae01e1f4fcc6bf/docs/class_and_method/README.md#nginxrequest-class
uri = req.var.uri
nginx_route = req.var.route
routes = NginxConfigUtil.parse_routes(config["routes"])
Expand Down

0 comments on commit aca1489

Please sign in to comment.