Skip to content

Commit

Permalink
Merge pull request #2 from intersystems/support-react
Browse files Browse the repository at this point in the history
Support React similarly to Angular
  • Loading branch information
isc-tleavitt authored Aug 8, 2022
2 parents 11fa821 + 84d4dc5 commit 755d0ea
Show file tree
Hide file tree
Showing 9 changed files with 579 additions and 372 deletions.
41 changes: 41 additions & 0 deletions CHANGELOG.md
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

22 changes: 2 additions & 20 deletions cls/pkg/isc/ipm/js/angular/pathLocationHandler.cls
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()
}

}
Loading

0 comments on commit 755d0ea

Please sign in to comment.