edgeone 1.0.9 → 1.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -122,6 +122,27 @@ edgeone switch
122
122
  ```
123
123
 
124
124
 
125
+ ### 8. Combine with front end
126
+ EdgeOne Pages CLI supports local development and debugging of EdgeOne Pages functions. If your project contains frontend code, you need to manually start the corresponding development service.
127
+
128
+ For frontend applications that need to access local functions, currently you need to distinguish function access paths through environment variables in your frontend code:
129
+
130
+ ```
131
+ // when start dev server
132
+ ENV=dev npm run build
133
+
134
+ //In your code
135
+ const REQUEST_API = process.env.ENV === 'dev' ? 'https://localhost:8088/' : '/'
136
+ ```
137
+
138
+
139
+ For functions involving cross-origin validation scenarios like login and authentication, you can specify the `--fePort` parameter when starting the development server.
140
+
141
+ ```
142
+ edgeone pages dev --fePort=8000 // your front dev server port
143
+ ```
144
+
145
+
125
146
  <br/>
126
147
 
127
148
  ## References