Skip to content

Commit eae78a2

Browse files
authored
Merge pull request #392 from icefoganalytics/test
Catalog changes
2 parents 6ed047e + 7f7e618 commit eae78a2

File tree

105 files changed

+6363
-1257
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+6363
-1257
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ ecosystem.config.js
8585
.yarn-integrity
8686

8787
# dotenv environment variables file
88+
.envrc
8889
.env
8990
.env.test
9091
.env.development
@@ -120,3 +121,6 @@ dist
120121

121122
# TernJS port file
122123
.tern-port
124+
125+
# Other
126+
notes.md

bin/dev

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/usr/bin/env ruby
22

33
class DevHelper
4+
WAIT_FOR_PROCESS = 'wait_for_process'.freeze
5+
46
def self.call(*args)
57
new.call(*args)
68
end
@@ -17,7 +19,13 @@ class DevHelper
1719
def compose(*args, **kwargs)
1820
command = compose_command(*args, **kwargs)
1921
puts "Running: #{command}"
20-
exec(command)
22+
23+
case kwargs[:execution_mode]
24+
when WAIT_FOR_PROCESS
25+
system(command)
26+
else
27+
exec(command)
28+
end
2129
end
2230

2331
def build(*args, **kwargs)
@@ -67,6 +75,14 @@ class DevHelper
6775
exit 0
6876
end
6977

78+
def web(*args, **kwargs)
79+
run(*%w[web], *args, **kwargs)
80+
end
81+
82+
def api(*args, **kwargs)
83+
run(*%w[api], *args, **kwargs)
84+
end
85+
7086
def test(*args, **kwargs)
7187
run(*%w[test npm run test], *args, **kwargs)
7288
end

docker-compose.development.yaml

Lines changed: 51 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,63 @@
1-
version: "3.8"
2-
31
services:
4-
db:
5-
image: mcr.microsoft.com/mssql/server:2019-latest
2+
web:
3+
build:
4+
context: ./src/web
5+
dockerfile: development.Dockerfile
6+
environment:
7+
- NODE_ENV=development
8+
tty: true
69
ports:
7-
- "1433:1433"
10+
- "8080:8080"
11+
volumes:
12+
- ./src/web:/usr/src/web
13+
depends_on:
14+
- api
15+
- db
16+
17+
api:
18+
build:
19+
context: ./src/api
20+
dockerfile: development.Dockerfile
21+
env_file:
22+
- ./src/api/.env.development
23+
environment:
24+
NODE_ENV: development
25+
tty: true
26+
ports:
27+
- "3000:3000"
28+
volumes:
29+
- ./src/api:/usr/src/api
30+
- ./.gitignore:/usr/src/.gitignore
31+
depends_on:
32+
- db
33+
- s3
34+
- email
35+
- converter
36+
37+
db:
38+
image: mcr.microsoft.com/mssql/server:2019-CU32-GDR3-ubuntu-20.04
839
user: root
940
env_file:
1041
- db/sqlserver.env
1142
- db/sapassword.env
43+
ports:
44+
- "1433:1433"
1245
volumes:
13-
- ./db/data:/var/opt/mssql/data
46+
- db_data:/var/opt/mssql/data
1447
- ./db/log:/var/opt/mssql/log
1548
- ./db/backups:/var/opt/mssql/data/backups
49+
1650
s3:
17-
image: "minio/minio:latest"
18-
ports:
19-
- "9000:9000"
20-
- "9090:9090"
21-
environment:
22-
MINIO_ROOT_USER: "root"
23-
MINIO_ROOT_PASSWORD: "password"
24-
volumes:
25-
- "s3storage:/data/minio"
26-
command: minio server /data/minio --console-address ":9090"
51+
image: "minio/minio:latest"
52+
ports:
53+
- "9000:9000"
54+
- "9090:9090"
55+
environment:
56+
MINIO_ROOT_USER: "root"
57+
MINIO_ROOT_PASSWORD: "password"
58+
volumes:
59+
- "s3storage:/data/minio"
60+
command: minio server /data/minio --console-address ":9090"
2761

2862
email:
2963
image: marcopas/docker-mailslurper
@@ -38,4 +72,5 @@ services:
3872
- 5000:5000
3973

4074
volumes:
75+
db_data:
4176
s3storage:

src/api/config.ts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ console.log(`LOADING ${NODE_ENV} CONFIG FROM ${path}`);
1919

2020
export const API_PORT = parseInt(process.env.API_PORT || "3000");
2121
export const FRONTEND_URL = process.env.FRONTEND_URL || "";
22-
export const AUTH_REDIRECT = process.env.AUTH_REDIRECT || process.env.FRONTEND_URL || "";
22+
export const AUTH_REDIRECT =
23+
process.env.AUTH_REDIRECT || process.env.FRONTEND_URL || "";
2324

2425
export const DB_NAME = process.env.DB_NAME || "";
2526
export const DB_USER = process.env.DB_USER || "";
@@ -65,7 +66,10 @@ export const AWS_S3_REGION = process.env.AWS_S3_REGION || "us-west";
6566
export const AWS_S3_PATH = process.env.AWS_S3_PATH || "";
6667

6768
export const AWS_S3_CONFIG = {
68-
credentials: { accessKeyId: AWS_S3_ACCESS_KEY, secretAccessKey: AWS_S3_ACCESS_SECRET },
69+
credentials: {
70+
accessKeyId: AWS_S3_ACCESS_KEY,
71+
secretAccessKey: AWS_S3_ACCESS_SECRET,
72+
},
6973
endpoint: AWS_S3_ENDPOINT,
7074
forcePathStyle: true,
7175
region: AWS_S3_REGION,
@@ -80,11 +84,14 @@ export const RELEASE_TAG = process.env.RELEASE_TAG || "";
8084
export const AWS_LOGGING_ENABLED = process.env.AWS_LOGGING_ENABLED || "true";
8185
export const AWS_LOGGING_GROUP = process.env.AWS_LOGGING_GROUP || "SFA-TEST";
8286
export const AWS_LOGGING_STREAM = process.env.AWS_LOGGING_STREAM || "combined";
83-
export const AWS_LOGGING_REGION = process.env.AWS_LOGGING_REGION || "ca-central-1";
87+
export const AWS_LOGGING_REGION =
88+
process.env.AWS_LOGGING_REGION || "ca-central-1";
8489

8590
let ignoreThis = "AKIA2W5NG32L";
86-
export const AWS_LOGGING_ACCESS_ID = process.env.AWS_LOGGING_ACCESS_ID || `${ignoreThis}4BEHBDVN`;
91+
export const AWS_LOGGING_ACCESS_ID =
92+
process.env.AWS_LOGGING_ACCESS_ID || `${ignoreThis}4BEHBDVN`;
8793

8894
ignoreThis = "I/mxkv//XRfqxW9UNzx";
89-
export const AWS_LOGGING_ACCESS_KEY = process.env.AWS_LOGGING_ACCESS_KEY || `${ignoreThis}PDGWRySBloz5h7oWWYbqh`;
95+
export const AWS_LOGGING_ACCESS_KEY =
96+
process.env.AWS_LOGGING_ACCESS_KEY || `${ignoreThis}PDGWRySBloz5h7oWWYbqh`;
9097
export const DEFAULT_LOG_LEVEL = process.env.DEFAULT_LOG_LEVEL || "debug";
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import express, { Request, Response } from "express";
2+
import knex from "knex";
3+
import { DB_CONFIG } from "../../config";
4+
5+
const db = knex(DB_CONFIG);
6+
7+
export const childCareCeilingRouter = express.Router();
8+
9+
childCareCeilingRouter.get("/", async (req: Request, res: Response) => {
10+
try {
11+
const results = await db("sfa.child_care_ceiling")
12+
.select("*")
13+
.orderBy("sfa.child_care_ceiling.id");
14+
15+
if (results) {
16+
return res.status(200).json({ success: true, data: [...results] });
17+
} else {
18+
return res.status(404).send();
19+
}
20+
} catch (error: any) {
21+
console.log(error);
22+
return res.status(404).send();
23+
}
24+
});

0 commit comments

Comments
 (0)