-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from intersystems/support-react
Support React similarly to Angular
- Loading branch information
Showing
9 changed files
with
579 additions
and
372 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# isc.ipm.js | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
## [Unreleased - 1.1.x] | ||
|
||
### Added | ||
- | ||
|
||
### Changed | ||
- | ||
|
||
### Fixed | ||
- | ||
|
||
### Security | ||
- | ||
|
||
### Removed | ||
- | ||
|
||
### Deprecated | ||
- | ||
|
||
## [1.1.0] - 2022-08-08 | ||
### Added | ||
- Added support for React project build/deployment | ||
|
||
### Changed | ||
- Refactored Angular-specific functionality into general-purpose/generic base class + toolset-specific implementations for Angular and React | ||
|
||
## [1.0.1] - 2022-06-21 | ||
### Fixed | ||
- Updated isc.json dependency to 2.0.0 (needed to work with latest isc.rest) | ||
|
||
## [1.0.0] - 2022-06-21 | ||
- First released version | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,9 @@ | ||
/// REST dispatch class to support Angular's path location strategy | ||
/// Serves index.html for all non-asset requests | ||
Class pkg.isc.ipm.js.angular.pathLocationHandler Extends %CSP.REST | ||
Class pkg.isc.ipm.js.angular.pathLocationHandler Extends pkg.isc.ipm.js.base.staticFilesHandler | ||
{ | ||
|
||
XData UrlMap [ XMLNamespace = "http://www.intersystems.com/urlmap" ] | ||
{ | ||
<Routes> | ||
<Route Url="/(.*)" Method="GET" Call="ServeStaticFile" /> | ||
</Routes> | ||
} | ||
Parameter STATICFILEREGEX = "^(assets/.*|.*\.(woff|woff2))$"; | ||
|
||
ClassMethod ServeStaticFile(pPath As %String) As %Status | ||
{ | ||
#dim %request As %CSP.Request | ||
#dim %response As %CSP.Response | ||
If $Match(pPath, "^(assets/.*|.*\.(woff|woff2))$"){ | ||
Do %response.SetHeader("cache-control", "public, max-age=31536000") | ||
} | ||
If '$Match(pPath,"^(assets/.*|.*\.(js|map|html|css|woff|woff2))$") { | ||
Set pPath = "index.html" | ||
} | ||
Do %request.Set("FILE",%request.Application_pPath) | ||
Quit ##class(%CSP.StreamServer).Page() | ||
} | ||
|
||
} |
Oops, something went wrong.