Skip to content

Commit d8308a2

Browse files
committed
Initial commit
Signed-off-by: kvmw <mshamsi@broadcom.com>
0 parents  commit d8308a2

24 files changed

Lines changed: 3001 additions & 0 deletions

.cfignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.git/
2+
node_modules/
3+
.DS_Store

.github/workflows/ci.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
branches: ['main']
6+
pull_request:
7+
branches: ['main']
8+
9+
jobs:
10+
check:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: '20'
21+
cache: 'npm'
22+
23+
- name: Install dependencies
24+
run: npm ci
25+
26+
- name: Check Lint
27+
run: npm run check

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Dependency directories
2+
node_modules/
3+
4+
# dotenv environment variable files
5+
.env
6+
.env.*
7+
!.env.development
8+
9+
.idea/

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules/
2+
dist/

.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"semi": true,
3+
"tabWidth": 2,
4+
"singleQuote": true,
5+
"trailingComma": "all",
6+
"printWidth": 80
7+
}

LICENSE

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
SOFTWARE LICENSE AGREEMENT
3+
4+
Copyright (c) VMware LLC. All rights reserved.
5+
6+
You are hereby granted a non-exclusive, worldwide, royalty-free license under VMware LLC’s copyrights to use, copy, modify, and distribute this software in source code or binary form for use in connection with VMware LLC products.
7+
8+
This copyright notice shall be included in all copies or substantial portions of the software.
9+
10+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Service Registry Node.js sample
2+
3+
![CI](https://github.com/spring-cloud-services-samples/greeting-nodejs/actions/workflows/ci.yml/badge.svg)
4+
5+
Sample Node.js application demonstrating the use of Service Registry in Tanzu Platform for Cloud Foundry.
6+
7+
For information on the Service Registry product in Tanzu Platform for Cloud Foundry, please [see the documentation](https://techdocs.broadcom.com/us/en/vmware-tanzu/spring/spring-cloud-services-for-cloud-foundry/3-3/scs-tanzu/service-registry-index.html).
8+
9+
## Building and Deploying
10+
11+
- Create a Service Registry instance:
12+
13+
```
14+
cf create-service p.service-registry standard greeter-service-registry
15+
```
16+
17+
- Install dependencies
18+
19+
```
20+
npm install
21+
```
22+
23+
- Push the `greeter-messages` application:
24+
25+
```
26+
cd packages/greeter-messages && cf push
27+
```
28+
29+
- Push the `greeter` application:
30+
31+
```
32+
cd packages/greeter && cf push
33+
```
34+
35+
## Trying It Out
36+
37+
Call `[ROUTE]/hello`, where `[ROUTE]` is the route bound to the `greeter` application, with optional `name` and `salutation` parameters.
38+
39+
```
40+
$ curl -k greeter.apps.example.cf-app.com/hello?name=John
41+
Hello, John!
42+
```

eslint.config.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { defineConfig, globalIgnores } from 'eslint/config';
2+
import globals from 'globals';
3+
import js from '@eslint/js';
4+
import prettier from 'eslint-plugin-prettier/recommended';
5+
6+
export default defineConfig([
7+
prettier,
8+
{ files: ['**/*.js'], languageOptions: { globals: globals.node } },
9+
{ files: ['**/*.js'], plugins: { js }, extends: ['js/recommended'] },
10+
globalIgnores(['node_modules/', 'dist/']),
11+
]);

0 commit comments

Comments
 (0)