https://github.com/ulbora/ulboratemplateservice
A micro service for application templates
https://github.com/ulbora/ulboratemplateservice
Last synced: about 2 months ago
JSON representation
A micro service for application templates
- Host: GitHub
- URL: https://github.com/ulbora/ulboratemplateservice
- Owner: Ulbora
- License: agpl-3.0
- Created: 2017-09-03T01:45:59.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2018-06-09T17:50:08.000Z (about 8 years ago)
- Last Synced: 2025-03-21T18:32:49.374Z (over 1 year ago)
- Language: Go
- Size: 7.45 MB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://goreportcard.com/report/github.com/Ulbora/UlboraTemplateService)
Ulbora Template Service
==============
A template micro service for CMS and Shopping Cart use
## Headers
- Content-Type: application/json (for POST and PUT)
- Authorization: Bearer aToken (POST, PUT, and DELETE. No token required for get services.)
- clientId: clientId (example 33477)
## Add Template
```
POST:
URL: http://localhost:3009/rs/template/add
Example Request
{
"name":"new template2",
"application": "cms"
}
```
```
Example Response
{
"success": true,
"id": 19
}
```
## Update Template Set Active
```
PUT:
URL: http://localhost:3009/rs/template/updateActive
Example Request
{
"id": 88,
"application": "cms"
}
```
```
Example Response
{
"success": true,
"id": 11
}
```
## Get Active Template
```
GET:
URL: http://localhost:3009/rs/template/get/cms/403
```
```
Example Response
{
"id": 88,
"name": "newtemplate2",
"application": "cms",
"active": true,
"clientId": 403
}
```
## Get Templates for a Client
```
GET:
URL: http://localhost:3009/rs/template/list/cms/403
```
```
Example Response
[
{
"id": 86,
"name": "newtemplate2",
"application": "cms",
"active": false,
"clientId": 403
},
{
"id": 87,
"name": "newtemplate2",
"application": "cms",
"active": false,
"clientId": 403
},
{
"id": 88,
"name": "newtemplate2",
"application": "cms",
"active": true,
"clientId": 403
}
]
```
## Delete Templates for a Client
```
DELETE:
URL: http://localhost:3009/rs/template/delete/107/403
```
```
Example Response
{
"success": true,
"id": 107
}
```
# Docker usage
```
docker run --network=ulbora_bridge --name templates --log-opt max-size=50m --env DATABASE_HOST=someHost /
--env DATABASE_USER_NAME=someName --env DATABASE_USER_PASSWORD=somePw --env DATABASE_NAME=ulbora_template_service /
--env DATABASE_POOL_SIZE=5 --env OAUTH2_VALIDATION_URI=http://oauth2:8080/rs/token/validate --env PORT=8080 /
--restart=always -d ulboralabs/templates sh
```