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
version: "3" | |
services: | |
mongo1: | |
hostname: mongo1 | |
container_name: localmongo1 | |
image: mongo:4.0-xenial | |
expose: | |
- 27017 | |
ports: | |
- 27011:27017 |
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
# Build the app | |
FROM node:12-alpine as build | |
WORKDIR /app | |
COPY package.json package-lock.json ./ | |
RUN npm install | |
COPY . . | |
RUN npm install -g @angular/cli | |
RUN ng build --prod --output-path=/dist | |
# Run in NGINX |
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
... | |
<script src="assets/env.js"></script> | |
</head> | |
<body> | |
<app-root> |
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
export const environment = { | |
apiUrl: window['env']['api'] || null, | |
gtmScript: `(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': | |
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], | |
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= | |
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); | |
})(window,document,'script','dataLayer', '${window['env']['gtm'] || 'GTM-XXXXXXX'}');` |
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
(function(window) { | |
window.env = window.env || {}; | |
// Environment variables | |
window["env"]["api"] = "${API_URL}"; | |
window["env"]["google_maps_api"] = "${GOOGLE_MAPS_API}"; | |
window["env"]["gtm"] = "${GTM}"; | |
})(this); |
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
(function(window) { | |
window["env"] = window["env"] || {}; | |
// Environment variables | |
window["env"]["api"] = "http://localhost:8000"; | |
window["env"]["google_maps_api"] = "xxxxxxxxxxxxxxxxxxxxxxxxxxxx"; | |
window["env"]["gtm"] = "GTM-xxxxxxx"; | |
})(this); |
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
import json | |
from marshmallow import ValidationError | |
from nameko_sqlalchemy import DatabaseSession | |
from werkzeug import Response | |
from books.exceptions import HttpError, NotFound, BadRequest | |
from books.models import DeclarativeBase, Book, Author | |
from books.schemas import BookSchema, CreateBookSchema | |
from datetime import datetime, timezone |
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
from marshmallow import Schema, fields | |
class AuthorSchema(Schema): | |
id = fields.Int(required=True) | |
name = fields.Str(required=True) | |
gender = fields.Str(required=True) | |
created_at = fields.Date() | |
updated_at = fields.Date() |
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
import datetime | |
import enum | |
from sqlalchemy import (Column, DateTime, ForeignKey, Integer, String, Enum) | |
from sqlalchemy.ext.declarative import declarative_base | |
from sqlalchemy.orm import relationship | |
class GenderEnum(enum.Enum): | |
Male = 'Male' |
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
[packages] | |
nameko = "==3.0.0-rc9" | |
nameko-sqlalchemy= "==1.5.0" | |
alembic = "==1.6.5" | |
marshmallow= "==2.19.2" | |
sqlalchemy= "==1.4.22" | |
psycopg2-binary= "==2.9.1" | |
[dev-packages] | |
pytest= "==4.5.0" |
NewerOlder