Skip to content

Commit c978a37

Browse files
authored
Revert "Use nimbella proxy provided netlify" (#14)
This reverts commit 67b110f.
1 parent ed21492 commit c978a37

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[![Join Slack](https://img.shields.io/badge/join-slack-9B69A0.svg)](https://nimbella-community.slack.com/)
77
[![Twitter](https://img.shields.io/twitter/follow/nimbella.svg?style=social&logo=twitter)](https://twitter.com/intent/follow?screen_name=nimbella)
88

9-
A Netlify Build Plugin that extends Netlify Sites with support for portable and stateful serverless functions using [Nimbella](https://nimbella.com/product/platform). The add-on enables Netlify developers to deploy serverless functions and stateful APIs to the Nimbella cloud 1) with more programming language choices, 2) easier packaging, 3) customizable runtimes and durations, and 4) cloud portability.
9+
A Netlify Build Plugin that extends Netlify Sites with support for portable and stateful serverless functions using [Nimbella](https://nimbella.com/product/platform). The add-on enables Netlify developers to deploy serverless functions and stateful APIs to the Nimbella cloud 1) with more programming language choices, 2) easier packaging, 3) customizable runtimes and durations, and 4) cloud portability.
1010

1111
Learn more about Nimbella's integration for Netlify from [here](https://nimbella.com/integrations/netlify).
1212

index.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ module.exports = {
115115
// Execute after build is done.
116116
onPostBuild: async ({constants, utils}) => {
117117
try {
118+
const {stdout: namespace} = await utils.run.command(`nim auth current`);
119+
118120
// Create env.json
119121
const envs = {...process.env};
120122
// Remove CI related variables.
@@ -161,7 +163,7 @@ module.exports = {
161163
if (redirect.to.startsWith('/.netlify/functions/')) {
162164
const redirectPath = redirect.to.split('/.netlify/functions/')[1];
163165
redirectRules.push(
164-
`${redirect.from} /.netlify/nimbella/default/${redirectPath} 301!`
166+
`${redirect.from} https://apigcp.nimbella.io/api/v1/web/${namespace}/default/${redirectPath} 200!`
165167
);
166168
}
167169
}
@@ -173,12 +175,14 @@ module.exports = {
173175
: redirectPath + '/';
174176

175177
if (isProject) {
176-
redirectRules.push(`${redirectPath}* /.netlify/nimbella/:splat 301!`);
178+
redirectRules.push(
179+
`${redirectPath}* https://apigcp.nimbella.io/api/v1/web/${namespace}/:splat 200!`
180+
);
177181
}
178182

179183
if (isActions && !isProject) {
180184
redirectRules.push(
181-
`${redirectPath}* /.netlify/nimbella/default/:splat 301!`
185+
`${redirectPath}* https://apigcp.nimbella.io/api/v1/web/${namespace}/default/:splat 200!`
182186
);
183187
}
184188

0 commit comments

Comments
 (0)