├── README.md ├── ch01 └── notepad01.txt ├── ch02 ├── Dockerfile ├── docker_logo.png ├── index_html_sample1.txt ├── index_html_sample2.txt └── notepad02.txt ├── ch03 └── notepad03.txt ├── ch04 ├── Dockerfile ├── index.php ├── index.php2 ├── index.php3 └── notepad04.txt ├── ch05 ├── Dockerfile ├── notepad05.txt └── runapp.js ├── ch06 ├── haproxy-2.cfg ├── haproxy-3.cfg ├── haproxy.cfg ├── nginx.conf └── notepad06.txt ├── ch07 ├── docker-prometheus │ ├── docker-compose.yaml │ ├── grafana │ │ └── datasource.yml │ └── prometheus │ │ └── prometheus.yml └── notepad07.txt ├── ch08 └── notepad08.txt ├── ch09 ├── add-gz │ ├── dockerfile-add │ └── webapp.tar.gz ├── conf │ └── dockerfile2 ├── django │ ├── Dockerfile │ ├── db.sqlite3 │ ├── manage.py │ ├── myproject │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-310.pyc │ │ │ ├── settings.cpython-310.pyc │ │ │ ├── urls.cpython-310.pyc │ │ │ ├── views.cpython-310.pyc │ │ │ └── wsgi.cpython-310.pyc │ │ ├── asgi.py │ │ ├── myapp │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-310.pyc │ │ │ │ ├── admin.cpython-310.pyc │ │ │ │ ├── apps.cpython-310.pyc │ │ │ │ └── models.cpython-310.pyc │ │ │ ├── admin.py │ │ │ ├── apps.py │ │ │ ├── migrations │ │ │ │ ├── __init__.py │ │ │ │ └── __pycache__ │ │ │ │ │ └── __init__.cpython-310.pyc │ │ │ ├── models.py │ │ │ ├── static │ │ │ │ ├── css │ │ │ │ │ └── style.css │ │ │ │ └── fastcampus.png │ │ │ ├── templates │ │ │ │ └── myapp │ │ │ │ │ └── index.html │ │ │ ├── tests.py │ │ │ ├── urls.py │ │ │ └── views.py │ │ ├── settings.py │ │ ├── urls.py │ │ ├── views.py │ │ └── wsgi.py │ └── requirements.txt ├── flask │ ├── .dockerignore │ ├── COAI │ │ ├── Dockerfile │ │ ├── app.py │ │ ├── requirements.txt │ │ ├── static │ │ │ ├── bootstrap │ │ │ │ ├── css │ │ │ │ │ ├── bootstrap-grid.min.css │ │ │ │ │ ├── bootstrap-reboot.min.css │ │ │ │ │ └── bootstrap.min.css │ │ │ │ └── js │ │ │ │ │ └── bootstrap.bundle.min.js │ │ │ ├── dropdown │ │ │ │ ├── css │ │ │ │ │ └── style.css │ │ │ │ └── js │ │ │ │ │ └── navbar-dropdown.js │ │ │ ├── embla │ │ │ │ ├── embla.min.js │ │ │ │ └── script.js │ │ │ ├── images │ │ │ │ ├── 2578773b593fa67420-594x334.webp │ │ │ │ ├── 3196469-16862104563397-500-500x600.webp │ │ │ │ ├── 3381238-16877504457812-500-500x500.webp │ │ │ │ ├── detail-2645649-2-500-432x518.webp │ │ │ │ ├── detail-3043508-16765278603381-500-500x600.webp │ │ │ │ ├── detail-3129731-16817899470786-500-500x600.webp │ │ │ │ ├── detail-33831-1-500-700x1050.webp │ │ │ │ ├── detail-33849-2-500-700x1050.webp │ │ │ │ ├── detail-33885-2-500-700x1050.webp │ │ │ │ ├── detail-33981-1-500-700x1050.webp │ │ │ │ ├── detail-33982-1-500-700x1050.webp │ │ │ │ ├── detail-33983-1-500-700x1050.webp │ │ │ │ ├── detail-33984-1-500-700x1050.webp │ │ │ │ ├── detail-33991-2-500-700x1050.webp │ │ │ │ ├── detail-34004-6-500-700x1050.webp │ │ │ │ ├── detail-34138-1-500-700x1050.webp │ │ │ │ ├── hashes.json │ │ │ │ ├── mbr-121x81.webp │ │ │ │ └── view.staff-6442410278bb8-432x648.webp │ │ │ ├── mobirise │ │ │ │ └── css │ │ │ │ │ └── mbr-additional.css │ │ │ ├── smoothscroll │ │ │ │ └── smooth-scroll.js │ │ │ ├── socicon │ │ │ │ ├── css │ │ │ │ │ └── styles.css │ │ │ │ └── fonts │ │ │ │ │ ├── socicon.eot │ │ │ │ │ ├── socicon.svg │ │ │ │ │ ├── socicon.ttf │ │ │ │ │ ├── socicon.woff │ │ │ │ │ └── socicon.woff2 │ │ │ ├── theme │ │ │ │ ├── css │ │ │ │ │ └── style.css │ │ │ │ └── js │ │ │ │ │ └── script.js │ │ │ ├── web │ │ │ │ └── assets │ │ │ │ │ └── mobirise-icons2 │ │ │ │ │ ├── mobirise2.css │ │ │ │ │ ├── mobirise2.eot │ │ │ │ │ ├── mobirise2.svg │ │ │ │ │ ├── mobirise2.ttf │ │ │ │ │ └── mobirise2.woff │ │ │ └── ytplayer │ │ │ │ └── index.js │ │ └── template │ │ │ ├── index.html │ │ │ ├── page1.html │ │ │ └── page2.html │ ├── Dockerfile │ ├── app.py │ ├── app │ │ ├── static │ │ │ ├── fastcampus.png │ │ │ └── style.css │ │ └── template │ │ │ └── index.html │ └── requirement.txt ├── java │ ├── Dockerfile │ ├── pom.xml │ ├── src │ │ ├── main │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── example │ │ │ │ │ ├── App.java │ │ │ │ │ └── MainApplication.java │ │ │ └── resources │ │ │ │ └── static │ │ │ │ ├── images │ │ │ │ └── fastcampus.png │ │ │ │ ├── index.html │ │ │ │ └── styles.css │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ └── AppTest.java │ └── target │ │ ├── classes │ │ ├── com │ │ │ └── example │ │ │ │ ├── App.class │ │ │ │ └── mywebapp │ │ │ │ └── MainApplication.class │ │ └── static │ │ │ ├── index.html │ │ │ └── styles.css │ │ ├── dependency │ │ ├── jackson-annotations-2.12.3.jar │ │ ├── jackson-core-2.12.3.jar │ │ ├── jackson-databind-2.12.3.jar │ │ ├── jackson-datatype-jdk8-2.12.3.jar │ │ ├── jackson-datatype-jsr310-2.12.3.jar │ │ ├── jackson-module-parameter-names-2.12.3.jar │ │ ├── jakarta.annotation-api-1.3.5.jar │ │ ├── jul-to-slf4j-1.7.31.jar │ │ ├── junit-3.8.1.jar │ │ ├── log4j-api-2.14.1.jar │ │ ├── log4j-to-slf4j-2.14.1.jar │ │ ├── logback-classic-1.2.3.jar │ │ ├── logback-core-1.2.3.jar │ │ ├── slf4j-api-1.7.25.jar │ │ ├── snakeyaml-1.28.jar │ │ ├── spring-aop-5.3.8.jar │ │ ├── spring-beans-5.3.8.jar │ │ ├── spring-boot-2.5.2.jar │ │ ├── spring-boot-autoconfigure-2.5.2.jar │ │ ├── spring-boot-starter-2.5.2.jar │ │ ├── spring-boot-starter-json-2.5.2.jar │ │ ├── spring-boot-starter-logging-2.5.2.jar │ │ ├── spring-boot-starter-tomcat-2.5.2.jar │ │ ├── spring-boot-starter-web-2.5.2.jar │ │ ├── spring-context-5.3.8.jar │ │ ├── spring-core-5.3.8.jar │ │ ├── spring-expression-5.3.8.jar │ │ ├── spring-jcl-5.3.8.jar │ │ ├── spring-web-5.3.8.jar │ │ ├── spring-webmvc-5.3.8.jar │ │ ├── tomcat-embed-core-9.0.48.jar │ │ ├── tomcat-embed-el-9.0.48.jar │ │ └── tomcat-embed-websocket-9.0.48.jar │ │ ├── maven-archiver │ │ └── pom.properties │ │ ├── maven-status │ │ └── maven-compiler-plugin │ │ │ ├── compile │ │ │ └── default-compile │ │ │ │ ├── createdFiles.lst │ │ │ │ └── inputFiles.lst │ │ │ └── testCompile │ │ │ └── default-testCompile │ │ │ ├── createdFiles.lst │ │ │ └── inputFiles.lst │ │ ├── my-web-app-1.0-SNAPSHOT.jar │ │ ├── surefire-reports │ │ ├── TEST-com.example.AppTest.xml │ │ └── com.example.AppTest.txt │ │ └── test-classes │ │ └── com │ │ └── example │ │ └── AppTest.class ├── lightweight1 │ ├── dockerfile-myweb1 │ ├── dockerfile-myweb2 │ └── dockerfile-myweb3 ├── lightweight2 │ ├── busybox │ ├── dockerfile-scratch │ ├── dockerfile-ubuntu │ ├── go-to-lightweight-image │ ├── go-to-lightweight-image.c │ └── rootfs.tar.xz ├── multi-stage │ ├── appstart.sh │ ├── dockerfile-app1 │ ├── dockerfile-app2 │ ├── dockerfile-go1 │ ├── dockerfile-go2 │ └── gostart.go ├── nodejs │ ├── .dockerignore │ ├── Dockerfile │ ├── node_modules │ │ ├── .package-lock.json │ │ ├── accepts │ │ │ ├── HISTORY.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── index.js │ │ │ └── package.json │ │ ├── array-flatten │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── array-flatten.js │ │ │ └── package.json │ │ ├── body-parser │ │ │ ├── HISTORY.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── SECURITY.md │ │ │ ├── index.js │ │ │ ├── lib │ │ │ │ ├── read.js │ │ │ │ └── types │ │ │ │ │ ├── json.js │ │ │ │ │ ├── raw.js │ │ │ │ │ ├── text.js │ │ │ │ │ └── urlencoded.js │ │ │ └── package.json │ │ ├── bytes │ │ │ ├── History.md │ │ │ ├── LICENSE │ │ │ ├── Readme.md │ │ │ ├── index.js │ │ │ └── package.json │ │ ├── call-bind │ │ │ ├── CHANGELOG.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── callBound.js │ │ │ ├── index.js │ │ │ ├── package.json │ │ │ └── test │ │ │ │ ├── callBound.js │ │ │ │ └── index.js │ │ ├── content-disposition │ │ │ ├── HISTORY.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── index.js │ │ │ └── package.json │ │ ├── content-type │ │ │ ├── HISTORY.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── index.js │ │ │ └── package.json │ │ ├── cookie-signature │ │ │ ├── History.md │ │ │ ├── Readme.md │ │ │ ├── index.js │ │ │ └── package.json │ │ ├── cookie │ │ │ ├── HISTORY.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── SECURITY.md │ │ │ ├── index.js │ │ │ └── package.json │ │ ├── debug │ │ │ ├── CHANGELOG.md │ │ │ ├── LICENSE │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── component.json │ │ │ ├── karma.conf.js │ │ │ ├── node.js │ │ │ ├── package.json │ │ │ └── src │ │ │ │ ├── browser.js │ │ │ │ ├── debug.js │ │ │ │ ├── index.js │ │ │ │ ├── inspector-log.js │ │ │ │ └── node.js │ │ ├── depd │ │ │ ├── History.md │ │ │ ├── LICENSE │ │ │ ├── Readme.md │ │ │ ├── index.js │ │ │ ├── lib │ │ │ │ └── browser │ │ │ │ │ └── index.js │ │ │ └── package.json │ │ ├── destroy │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── index.js │ │ │ └── package.json │ │ ├── ee-first │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── index.js │ │ │ └── package.json │ │ ├── encodeurl │ │ │ ├── HISTORY.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── index.js │ │ │ └── package.json │ │ ├── escape-html │ │ │ ├── LICENSE │ │ │ ├── Readme.md │ │ │ ├── index.js │ │ │ └── package.json │ │ ├── etag │ │ │ ├── HISTORY.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── index.js │ │ │ └── package.json │ │ ├── express │ │ │ ├── History.md │ │ │ ├── LICENSE │ │ │ ├── index.js │ │ │ ├── lib │ │ │ │ ├── application.js │ │ │ │ ├── express.js │ │ │ │ ├── middleware │ │ │ │ │ ├── init.js │ │ │ │ │ └── query.js │ │ │ │ ├── request.js │ │ │ │ ├── response.js │ │ │ │ ├── router │ │ │ │ │ ├── index.js │ │ │ │ │ ├── layer.js │ │ │ │ │ └── route.js │ │ │ │ ├── utils.js │ │ │ │ └── view.js │ │ │ └── package.json │ │ ├── finalhandler │ │ │ ├── HISTORY.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── SECURITY.md │ │ │ ├── index.js │ │ │ └── package.json │ │ ├── forwarded │ │ │ ├── HISTORY.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── index.js │ │ │ └── package.json │ │ ├── fresh │ │ │ ├── HISTORY.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── index.js │ │ │ └── package.json │ │ ├── function-bind │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── implementation.js │ │ │ ├── index.js │ │ │ ├── package.json │ │ │ └── test │ │ │ │ └── index.js │ │ ├── get-intrinsic │ │ │ ├── CHANGELOG.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── index.js │ │ │ ├── package.json │ │ │ └── test │ │ │ │ └── GetIntrinsic.js │ │ ├── has-proto │ │ │ ├── CHANGELOG.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── index.js │ │ │ ├── package.json │ │ │ └── test │ │ │ │ └── index.js │ │ ├── has-symbols │ │ │ ├── CHANGELOG.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── index.js │ │ │ ├── package.json │ │ │ ├── shams.js │ │ │ └── test │ │ │ │ ├── index.js │ │ │ │ ├── shams │ │ │ │ ├── core-js.js │ │ │ │ └── get-own-property-symbols.js │ │ │ │ └── tests.js │ │ ├── has │ │ │ ├── LICENSE-MIT │ │ │ ├── README.md │ │ │ ├── package.json │ │ │ ├── src │ │ │ │ └── index.js │ │ │ └── test │ │ │ │ └── index.js │ │ ├── http-errors │ │ │ ├── HISTORY.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── index.js │ │ │ └── package.json │ │ ├── iconv-lite │ │ │ ├── Changelog.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── encodings │ │ │ │ ├── dbcs-codec.js │ │ │ │ ├── dbcs-data.js │ │ │ │ ├── index.js │ │ │ │ ├── internal.js │ │ │ │ ├── sbcs-codec.js │ │ │ │ ├── sbcs-data-generated.js │ │ │ │ ├── sbcs-data.js │ │ │ │ ├── tables │ │ │ │ │ ├── big5-added.json │ │ │ │ │ ├── cp936.json │ │ │ │ │ ├── cp949.json │ │ │ │ │ ├── cp950.json │ │ │ │ │ ├── eucjp.json │ │ │ │ │ ├── gb18030-ranges.json │ │ │ │ │ ├── gbk-added.json │ │ │ │ │ └── shiftjis.json │ │ │ │ ├── utf16.js │ │ │ │ └── utf7.js │ │ │ ├── lib │ │ │ │ ├── bom-handling.js │ │ │ │ ├── extend-node.js │ │ │ │ ├── index.d.ts │ │ │ │ ├── index.js │ │ │ │ └── streams.js │ │ │ └── package.json │ │ ├── inherits │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── inherits.js │ │ │ ├── inherits_browser.js │ │ │ └── package.json │ │ ├── ipaddr.js │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── ipaddr.min.js │ │ │ ├── lib │ │ │ │ ├── ipaddr.js │ │ │ │ └── ipaddr.js.d.ts │ │ │ └── package.json │ │ ├── media-typer │ │ │ ├── HISTORY.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── index.js │ │ │ └── package.json │ │ ├── merge-descriptors │ │ │ ├── HISTORY.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── index.js │ │ │ └── package.json │ │ ├── methods │ │ │ ├── HISTORY.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── index.js │ │ │ └── package.json │ │ ├── mime-db │ │ │ ├── HISTORY.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── db.json │ │ │ ├── index.js │ │ │ └── package.json │ │ ├── mime-types │ │ │ ├── HISTORY.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── index.js │ │ │ └── package.json │ │ ├── mime │ │ │ ├── CHANGELOG.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── cli.js │ │ │ ├── mime.js │ │ │ ├── package.json │ │ │ ├── src │ │ │ │ ├── build.js │ │ │ │ └── test.js │ │ │ └── types.json │ │ ├── ms │ │ │ ├── index.js │ │ │ ├── license.md │ │ │ ├── package.json │ │ │ └── readme.md │ │ ├── negotiator │ │ │ ├── HISTORY.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── index.js │ │ │ ├── lib │ │ │ │ ├── charset.js │ │ │ │ ├── encoding.js │ │ │ │ ├── language.js │ │ │ │ └── mediaType.js │ │ │ └── package.json │ │ ├── object-inspect │ │ │ ├── CHANGELOG.md │ │ │ ├── LICENSE │ │ │ ├── example │ │ │ │ ├── all.js │ │ │ │ ├── circular.js │ │ │ │ ├── fn.js │ │ │ │ └── inspect.js │ │ │ ├── index.js │ │ │ ├── package-support.json │ │ │ ├── package.json │ │ │ ├── readme.markdown │ │ │ ├── test-core-js.js │ │ │ ├── test │ │ │ │ ├── bigint.js │ │ │ │ ├── browser │ │ │ │ │ └── dom.js │ │ │ │ ├── circular.js │ │ │ │ ├── deep.js │ │ │ │ ├── element.js │ │ │ │ ├── err.js │ │ │ │ ├── fakes.js │ │ │ │ ├── fn.js │ │ │ │ ├── has.js │ │ │ │ ├── holes.js │ │ │ │ ├── indent-option.js │ │ │ │ ├── inspect.js │ │ │ │ ├── lowbyte.js │ │ │ │ ├── number.js │ │ │ │ ├── quoteStyle.js │ │ │ │ ├── toStringTag.js │ │ │ │ ├── undef.js │ │ │ │ └── values.js │ │ │ └── util.inspect.js │ │ ├── on-finished │ │ │ ├── HISTORY.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── index.js │ │ │ └── package.json │ │ ├── parseurl │ │ │ ├── HISTORY.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── index.js │ │ │ └── package.json │ │ ├── path-to-regexp │ │ │ ├── History.md │ │ │ ├── LICENSE │ │ │ ├── Readme.md │ │ │ ├── index.js │ │ │ └── package.json │ │ ├── proxy-addr │ │ │ ├── HISTORY.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── index.js │ │ │ └── package.json │ │ ├── qs │ │ │ ├── CHANGELOG.md │ │ │ ├── LICENSE.md │ │ │ ├── README.md │ │ │ ├── dist │ │ │ │ └── qs.js │ │ │ ├── lib │ │ │ │ ├── formats.js │ │ │ │ ├── index.js │ │ │ │ ├── parse.js │ │ │ │ ├── stringify.js │ │ │ │ └── utils.js │ │ │ ├── package.json │ │ │ └── test │ │ │ │ ├── parse.js │ │ │ │ ├── stringify.js │ │ │ │ └── utils.js │ │ ├── range-parser │ │ │ ├── HISTORY.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── index.js │ │ │ └── package.json │ │ ├── raw-body │ │ │ ├── HISTORY.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── SECURITY.md │ │ │ ├── index.d.ts │ │ │ ├── index.js │ │ │ └── package.json │ │ ├── safe-buffer │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── index.d.ts │ │ │ ├── index.js │ │ │ └── package.json │ │ ├── safer-buffer │ │ │ ├── LICENSE │ │ │ ├── Porting-Buffer.md │ │ │ ├── Readme.md │ │ │ ├── dangerous.js │ │ │ ├── package.json │ │ │ ├── safer.js │ │ │ └── tests.js │ │ ├── send │ │ │ ├── HISTORY.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── SECURITY.md │ │ │ ├── index.js │ │ │ ├── node_modules │ │ │ │ └── ms │ │ │ │ │ ├── index.js │ │ │ │ │ ├── license.md │ │ │ │ │ ├── package.json │ │ │ │ │ └── readme.md │ │ │ └── package.json │ │ ├── serve-static │ │ │ ├── HISTORY.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── index.js │ │ │ └── package.json │ │ ├── setprototypeof │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── index.d.ts │ │ │ ├── index.js │ │ │ ├── package.json │ │ │ └── test │ │ │ │ └── index.js │ │ ├── side-channel │ │ │ ├── CHANGELOG.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── index.js │ │ │ ├── package.json │ │ │ └── test │ │ │ │ └── index.js │ │ ├── statuses │ │ │ ├── HISTORY.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── codes.json │ │ │ ├── index.js │ │ │ └── package.json │ │ ├── toidentifier │ │ │ ├── HISTORY.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── index.js │ │ │ └── package.json │ │ ├── type-is │ │ │ ├── HISTORY.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── index.js │ │ │ └── package.json │ │ ├── unpipe │ │ │ ├── HISTORY.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── index.js │ │ │ └── package.json │ │ ├── utils-merge │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── index.js │ │ │ └── package.json │ │ └── vary │ │ │ ├── HISTORY.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── index.js │ │ │ └── package.json │ ├── package-lock.json │ ├── package.json │ ├── public │ │ ├── images │ │ │ └── fastcampus.png │ │ ├── index.html │ │ └── styles.css │ └── server.js ├── notepad09.txt ├── py_flask │ ├── .dockerignore │ ├── app │ │ ├── py_app.py │ │ └── requirements.txt │ └── dockerfile-py └── sample │ ├── Dockerfile │ └── index.html ├── ch10 ├── flask-redis │ ├── Dockerfile │ ├── app │ │ ├── py_app.py │ │ └── requirements.txt │ ├── docker-compose.yaml │ └── scale-test │ │ └── docker-compose.yaml ├── my-diary-3-proxy │ ├── docker-compose.yaml │ ├── my-diary-back │ │ ├── Dockerfile │ │ └── rollingpaper │ │ │ ├── build.gradle │ │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ └── gradle-wrapper.properties │ │ │ ├── gradlew │ │ │ ├── gradlew.bat │ │ │ ├── settings.gradle │ │ │ └── src │ │ │ ├── main │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── threetier │ │ │ │ │ └── team1 │ │ │ │ │ └── rollingpaper │ │ │ │ │ ├── DTO │ │ │ │ │ ├── ApiResponseDTO.java │ │ │ │ │ └── PaperDTO.java │ │ │ │ │ ├── RollingpaperApplication.java │ │ │ │ │ ├── controller │ │ │ │ │ └── PaperController.java │ │ │ │ │ ├── domain │ │ │ │ │ └── Paper.java │ │ │ │ │ ├── repository │ │ │ │ │ └── PaperRepository.java │ │ │ │ │ └── service │ │ │ │ │ ├── PaperService.java │ │ │ │ │ └── PaperServiceImpl.java │ │ │ └── resources │ │ │ │ └── application.yml │ │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── threetier │ │ │ └── team1 │ │ │ └── rollingpaper │ │ │ ├── RollingpaperApplicationTests.java │ │ │ └── service │ │ │ └── PaperServiceImplTest.java │ ├── my-diary-front │ │ ├── Dockerfile │ │ ├── Jenkinsfile.txt │ │ ├── app.js │ │ ├── fastcampus.png │ │ ├── package-lock.json │ │ ├── package.json │ │ └── public │ │ │ ├── fastcampus.png │ │ │ ├── index.ejs │ │ │ ├── index.js │ │ │ └── style.css │ └── proxy │ │ ├── nginx-be.conf │ │ └── nginx-fe.conf ├── my-diary-3 │ ├── docker-compose.yaml │ ├── my-diary-back │ │ ├── Dockerfile │ │ └── rollingpaper │ │ │ ├── build.gradle │ │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ └── gradle-wrapper.properties │ │ │ ├── gradlew │ │ │ ├── gradlew.bat │ │ │ ├── settings.gradle │ │ │ └── src │ │ │ ├── main │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── threetier │ │ │ │ │ └── team1 │ │ │ │ │ └── rollingpaper │ │ │ │ │ ├── DTO │ │ │ │ │ ├── ApiResponseDTO.java │ │ │ │ │ └── PaperDTO.java │ │ │ │ │ ├── RollingpaperApplication.java │ │ │ │ │ ├── controller │ │ │ │ │ └── PaperController.java │ │ │ │ │ ├── domain │ │ │ │ │ └── Paper.java │ │ │ │ │ ├── repository │ │ │ │ │ └── PaperRepository.java │ │ │ │ │ └── service │ │ │ │ │ ├── PaperService.java │ │ │ │ │ └── PaperServiceImpl.java │ │ │ └── resources │ │ │ │ └── application.yml │ │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── threetier │ │ │ └── team1 │ │ │ └── rollingpaper │ │ │ ├── RollingpaperApplicationTests.java │ │ │ └── service │ │ │ └── PaperServiceImplTest.java │ └── my-diary-front │ │ ├── Dockerfile │ │ ├── app.js │ │ ├── fastcampus.png │ │ ├── package-lock.json │ │ ├── package.json │ │ └── public │ │ ├── fastcampus.png │ │ ├── index.ejs │ │ ├── index.js │ │ └── style.css ├── my-diary-compose │ └── docker-compose.yaml ├── my-diary │ ├── my-diary-back │ │ ├── Dockerfile │ │ └── rollingpaper │ │ │ ├── build.gradle │ │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ └── gradle-wrapper.properties │ │ │ ├── gradlew │ │ │ ├── gradlew.bat │ │ │ ├── settings.gradle │ │ │ └── src │ │ │ ├── main │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── threetier │ │ │ │ │ └── team1 │ │ │ │ │ └── rollingpaper │ │ │ │ │ ├── DTO │ │ │ │ │ ├── ApiResponseDTO.java │ │ │ │ │ └── PaperDTO.java │ │ │ │ │ ├── RollingpaperApplication.java │ │ │ │ │ ├── controller │ │ │ │ │ └── PaperController.java │ │ │ │ │ ├── domain │ │ │ │ │ └── Paper.java │ │ │ │ │ ├── repository │ │ │ │ │ └── PaperRepository.java │ │ │ │ │ └── service │ │ │ │ │ ├── PaperService.java │ │ │ │ │ └── PaperServiceImpl.java │ │ │ └── resources │ │ │ │ └── application.yml │ │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── threetier │ │ │ └── team1 │ │ │ └── rollingpaper │ │ │ ├── RollingpaperApplicationTests.java │ │ │ └── service │ │ │ └── PaperServiceImplTest.java │ └── my-diary-front │ │ ├── Dockerfile │ │ ├── app.js │ │ ├── fastcampus.png │ │ ├── package-lock.json │ │ ├── package.json │ │ └── public │ │ ├── fastcampus.png │ │ ├── index.ejs │ │ ├── index.js │ │ └── style.css ├── my-webdb │ ├── docker-compose.yaml │ └── myweb-log │ │ └── apache2 │ │ ├── access.log │ │ ├── error.log │ │ └── other_vhosts_access.log ├── nginx-compose │ ├── docker-compose.yaml │ ├── nginx_alb │ │ ├── Dockerfile.alb │ │ └── nginx.conf │ ├── pyfla_app1 │ │ ├── Dockerfile.app1 │ │ ├── pyfla_app1.py │ │ └── requirements.txt │ ├── pyfla_app2 │ │ ├── Dockerfile.app2 │ │ ├── pyfla_app2.py │ │ └── requirements.txt │ └── pyfla_app3 │ │ ├── Dockerfile.app3 │ │ ├── pyfla_app3.py │ │ └── requirements.txt ├── notepad10.txt └── web-count │ ├── Dockerfile │ ├── app.py │ ├── docker-compose.yml │ ├── requirements.txt │ ├── static │ ├── css │ │ └── bootstrap.css │ └── images │ │ ├── cloud-01.png │ │ ├── cloud-02.png │ │ ├── cloud-03.png │ │ ├── cloud-04.png │ │ ├── cloud-05.png │ │ ├── docker_logo.png │ │ ├── fastcampus.png │ │ └── k8s_logo.png │ └── templates │ └── index.html ├── ch11 ├── haproxy-nginx │ └── haproxy-web-stack.yaml ├── notepad11.txt └── webapi-stack.yaml ├── ch12 └── notepad12.txt ├── ch13 ├── django │ ├── Dockerfile │ ├── app │ │ ├── bin │ │ │ └── gunicorn_start │ │ ├── cmd │ │ │ └── start │ │ └── larva │ │ │ ├── common │ │ │ ├── __pycache__ │ │ │ │ ├── admin.cpython-310.pyc │ │ │ │ └── apps.cpython-310.pyc │ │ │ ├── admin.py │ │ │ ├── apps.py │ │ │ ├── migrations │ │ │ │ └── 0001_initial.py │ │ │ └── views.py │ │ │ ├── larva │ │ │ ├── __pycache__ │ │ │ │ └── settings.cpython-310.pyc │ │ │ ├── asgi.py │ │ │ ├── settings.py │ │ │ ├── test_runner.py │ │ │ ├── urls.py │ │ │ ├── views.py │ │ │ └── wsgi.py │ │ │ ├── manage.py │ │ │ ├── static │ │ │ └── common │ │ │ │ ├── css │ │ │ │ ├── base.css │ │ │ │ └── index.css │ │ │ │ ├── fastcampus.ico │ │ │ │ ├── fonts │ │ │ │ ├── NanumBarunGothic.ttf │ │ │ │ ├── NanumBarunGothicBold.ttf │ │ │ │ ├── NanumBarunGothicLight.ttf │ │ │ │ └── NanumBarunGothicUltraLight.ttf │ │ │ │ └── img │ │ │ │ ├── logo_list.png │ │ │ │ ├── logo_main_fast.png │ │ │ │ └── logo_reservation.png │ │ │ └── templates │ │ │ └── common │ │ │ ├── base.html │ │ │ └── index.html │ └── build_and_push.sh ├── nginx │ ├── Dockerfile │ ├── build_and_push.sh │ └── nginx.conf └── notepad13.txt └── ch14 ├── notepad14.txt └── web-count ├── Dockerfile ├── Jenkinsfile ├── app.py ├── docker-compose.yml ├── docker-compose.yml.2 ├── requirements.txt ├── static ├── css │ └── bootstrap.css └── images │ ├── cloud-01.png │ ├── cloud-02.png │ ├── cloud-03.png │ ├── cloud-04.png │ ├── cloud-05.png │ ├── docker_logo.png │ ├── fastcampus.png │ └── k8s_logo.png └── templates └── index.html /README.md: -------------------------------------------------------------------------------- 1 | # fastcampus 2 | CI/CD all in one stop: from Docker to GitOps. 3 | -------------------------------------------------------------------------------- /ch01/notepad01.txt: -------------------------------------------------------------------------------- 1 | # ch01 2 | -------------------------------------------------------------------------------- /ch02/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginx:1.25.0-alpine 2 | COPY index-image.html /usr/share/nginx/html/index.html 3 | COPY docker_logo.png /usr/share/nginx/html/docker_logo.png 4 | EXPOSE 80 5 | CMD ["nginx", "-g", "daemon off;"] 6 | 7 | -------------------------------------------------------------------------------- /ch02/docker_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch02/docker_logo.png -------------------------------------------------------------------------------- /ch02/index_html_sample1.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | Docker Container Running Sample App. 4 | 5 | 6 | 7 | 8 |
9 |

Docker Container Web Application.

10 |

"fastcampus"

11 |

Application is now good running on a Docker Container.

12 |
13 | 14 | 15 | -------------------------------------------------------------------------------- /ch02/index_html_sample2.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | Docker Container App 4 | 6 | 7 | 8 |
9 |

Docker Container Sample Application.

10 |

"fastcampus"

11 |

Your application is now running on a container in Docker Container.

12 |
13 | 14 | 15 | -------------------------------------------------------------------------------- /ch02/notepad02.txt: -------------------------------------------------------------------------------- 1 | # ch02 2 | -------------------------------------------------------------------------------- /ch03/notepad03.txt: -------------------------------------------------------------------------------- 1 | # ch03 2 | -------------------------------------------------------------------------------- /ch04/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:7.2-apache 2 | 3 | MAINTAINER datastory Hub 4 | 5 | ADD index.php /var/www/html/index.php 6 | 7 | EXPOSE 80 8 | 9 | CMD ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"] 10 | -------------------------------------------------------------------------------- /ch04/index.php: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 9 |

Welcome to the Container world~!

10 |
11 | 12 | 13 | -------------------------------------------------------------------------------- /ch04/index.php2: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 9 |

Welcome to the Humans~!

10 | 11 |
12 | 13 | 14 | -------------------------------------------------------------------------------- /ch04/index.php3: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 11 |

Docker Load Balancer = (Nginx host) + (PHP & Apache contaier)

12 |
13 | 14 | 15 | -------------------------------------------------------------------------------- /ch04/notepad04.txt: -------------------------------------------------------------------------------- 1 | # ch04 2 | -------------------------------------------------------------------------------- /ch05/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:20-alpine3.17 2 | 3 | RUN apk add --no-cache tini curl 4 | 5 | WORKDIR /app 6 | 7 | COPY runapp.js . 8 | 9 | EXPOSE 6060 10 | 11 | ENTRYPOINT ["/sbin/tini", "--"] 12 | 13 | CMD ["node", "runapp.js"] 14 | -------------------------------------------------------------------------------- /ch05/runapp.js: -------------------------------------------------------------------------------- 1 | const http = require('http'); 2 | 3 | const server = http.createServer().listen(6060); 4 | 5 | server.on('request', (req, res) => { 6 | console.log('Your request arrived.'); 7 | res.write("HostName: " + process.env.HOSTNAME + "\n"); 8 | res.end(); 9 | }); 10 | 11 | server.on('connection', (socket) => { 12 | console.log("Your Connected."); 13 | }); 14 | -------------------------------------------------------------------------------- /ch06/haproxy-2.cfg: -------------------------------------------------------------------------------- 1 | global 2 | stats socket /var/run/api.sock user haproxy group haproxy mode 660 level admin expose-fd listeners 3 | log stdout format raw local0 info 4 | 5 | defaults 6 | mode http 7 | timeout client 10s 8 | timeout connect 5s 9 | timeout server 10s 10 | timeout http-request 10s 11 | log global 12 | 13 | frontend stats 14 | bind *:8404 15 | stats enable 16 | stats uri / 17 | stats refresh 10s 18 | 19 | frontend myfrontend 20 | bind :80 21 | default_backend webservers 22 | 23 | acl path-echo-web1 path_beg /echo-web1 24 | acl path-echo-web2 path_beg /echo-web2 25 | acl path-echo-web3 path_beg /echo-web3 26 | 27 | use_backend echo-web1_backend if path-echo-web1 28 | use_backend echo-web2_backend if path-echo-web2 29 | use_backend echo-web3_backend if path-echo-web3 30 | 31 | backend webservers 32 | balance roundrobin 33 | server s1 echo-web1:8080 check 34 | server s2 echo-web2:8080 check 35 | server s3 echo-web3:8080 check 36 | 37 | backend echo-web1_backend 38 | server s1 echo-web1:8080 check 39 | 40 | backend echo-web2_backend 41 | server s2 echo-web2:8080 check 42 | 43 | backend echo-web3_backend 44 | server s3 echo-web3:8080 check 45 | -------------------------------------------------------------------------------- /ch06/haproxy.cfg: -------------------------------------------------------------------------------- 1 | global 2 | stats socket /var/run/api.sock user haproxy group haproxy mode 660 level admin expose-fd listeners 3 | log stdout format raw local0 info 4 | 5 | defaults 6 | mode http 7 | timeout client 10s 8 | timeout connect 5s 9 | timeout server 10s 10 | timeout http-request 10s 11 | log global 12 | 13 | frontend stats 14 | bind *:8404 15 | stats enable 16 | stats uri / 17 | stats refresh 10s 18 | 19 | frontend myfrontend 20 | bind :80 21 | default_backend webservers 22 | 23 | backend webservers 24 | server s1 echo-web1:8080 check 25 | server s2 echo-web2:8080 check 26 | server s3 echo-web3:8080 check 27 | -------------------------------------------------------------------------------- /ch06/nginx.conf: -------------------------------------------------------------------------------- 1 | events { worker_connections 1024; } 2 | http { 3 | # List of application servers 4 | upstream backend-alb { 5 | server 127.0.0.1:5001; 6 | server 127.0.0.1:5002; 7 | server 127.0.0.1:5003; 8 | } 9 | # Configuration for the server 10 | server { 11 | # Running port 12 | listen 80 default_server; 13 | # Proxying the connections 14 | location / { 15 | proxy_pass http://backend-alb; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /ch06/notepad06.txt: -------------------------------------------------------------------------------- 1 | # ch06 2 | -------------------------------------------------------------------------------- /ch07/docker-prometheus/grafana/datasource.yml: -------------------------------------------------------------------------------- 1 | apiVersion: 1 2 | 3 | deleteDatasources: 4 | - name: Prometheus 5 | 6 | datasources: 7 | - name: Prometheus 8 | type: prometheus 9 | access: proxy 10 | orgId: 1 11 | url: http://prometheus:9090 12 | basicAuth: false 13 | isDefault: false 14 | version: 1 15 | editable: false 16 | -------------------------------------------------------------------------------- /ch07/notepad07.txt: -------------------------------------------------------------------------------- 1 | ch07 2 | -------------------------------------------------------------------------------- /ch08/notepad08.txt: -------------------------------------------------------------------------------- 1 | # ch08 2 | -------------------------------------------------------------------------------- /ch09/add-gz/dockerfile-add: -------------------------------------------------------------------------------- 1 | FROM ubuntu:14.04 2 | MAINTAINER "kevin-lee " 3 | LABEL "purpose"="webserver practice" 4 | RUN apt-get update && apt-get -y install apache2 \ 5 | vim \ 6 | curl \ 7 | && rm -rf /var/lib/apt/lists/* \ 8 | && rm -rf /etc/apt/sources.list.d/* 9 | 10 | ADD webapp.tar.gz /var/www/html 11 | WORKDIR /var/www/html 12 | EXPOSE 80 13 | CMD /usr/sbin/apache2ctl -D FOREGROUND 14 | -------------------------------------------------------------------------------- /ch09/add-gz/webapp.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/add-gz/webapp.tar.gz -------------------------------------------------------------------------------- /ch09/conf/dockerfile2: -------------------------------------------------------------------------------- 1 | FROM ubuntu:22.04 2 | 3 | RUN apt-get update && apt-get install -y nginx \ 4 | curl \ 5 | vim 6 | 7 | RUN echo 'Docker Container Application.' > /var/www/html/index.html 8 | 9 | EXPOSE 80 10 | 11 | CMD ["nginx", "-g", "daemon off;"] 12 | -------------------------------------------------------------------------------- /ch09/django/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.9 2 | 3 | ENV PYTHONDONTWRITEBYTECODE 1 4 | ENV PYTHONUNBUFFERED 1 5 | 6 | WORKDIR /app 7 | 8 | COPY requirements.txt . 9 | RUN pip install -r requirements.txt 10 | 11 | COPY . . 12 | 13 | # Collect static files 14 | RUN python manage.py collectstatic --noinput 15 | 16 | # Install Gunicorn 17 | RUN pip install gunicorn 18 | 19 | # Use Gunicorn as the server 20 | CMD ["gunicorn", "--bind", "0.0.0.0:8000", "myproject.wsgi:application"] 21 | 22 | -------------------------------------------------------------------------------- /ch09/django/db.sqlite3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/django/db.sqlite3 -------------------------------------------------------------------------------- /ch09/django/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | """Django's command-line utility for administrative tasks.""" 3 | import os 4 | import sys 5 | 6 | 7 | def main(): 8 | """Run administrative tasks.""" 9 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myproject.settings') 10 | try: 11 | from django.core.management import execute_from_command_line 12 | except ImportError as exc: 13 | raise ImportError( 14 | "Couldn't import Django. Are you sure it's installed and " 15 | "available on your PYTHONPATH environment variable? Did you " 16 | "forget to activate a virtual environment?" 17 | ) from exc 18 | execute_from_command_line(sys.argv) 19 | 20 | 21 | if __name__ == '__main__': 22 | main() 23 | -------------------------------------------------------------------------------- /ch09/django/myproject/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/django/myproject/__init__.py -------------------------------------------------------------------------------- /ch09/django/myproject/__pycache__/__init__.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/django/myproject/__pycache__/__init__.cpython-310.pyc -------------------------------------------------------------------------------- /ch09/django/myproject/__pycache__/settings.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/django/myproject/__pycache__/settings.cpython-310.pyc -------------------------------------------------------------------------------- /ch09/django/myproject/__pycache__/urls.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/django/myproject/__pycache__/urls.cpython-310.pyc -------------------------------------------------------------------------------- /ch09/django/myproject/__pycache__/views.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/django/myproject/__pycache__/views.cpython-310.pyc -------------------------------------------------------------------------------- /ch09/django/myproject/__pycache__/wsgi.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/django/myproject/__pycache__/wsgi.cpython-310.pyc -------------------------------------------------------------------------------- /ch09/django/myproject/asgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | ASGI config for myproject project. 3 | 4 | It exposes the ASGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.2/howto/deployment/asgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.asgi import get_asgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myproject.settings') 15 | 16 | application = get_asgi_application() 17 | -------------------------------------------------------------------------------- /ch09/django/myproject/myapp/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/django/myproject/myapp/__init__.py -------------------------------------------------------------------------------- /ch09/django/myproject/myapp/__pycache__/__init__.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/django/myproject/myapp/__pycache__/__init__.cpython-310.pyc -------------------------------------------------------------------------------- /ch09/django/myproject/myapp/__pycache__/admin.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/django/myproject/myapp/__pycache__/admin.cpython-310.pyc -------------------------------------------------------------------------------- /ch09/django/myproject/myapp/__pycache__/apps.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/django/myproject/myapp/__pycache__/apps.cpython-310.pyc -------------------------------------------------------------------------------- /ch09/django/myproject/myapp/__pycache__/models.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/django/myproject/myapp/__pycache__/models.cpython-310.pyc -------------------------------------------------------------------------------- /ch09/django/myproject/myapp/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /ch09/django/myproject/myapp/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class MyappConfig(AppConfig): 5 | default_auto_field = 'django.db.models.BigAutoField' 6 | name = 'myproject.myapp' 7 | -------------------------------------------------------------------------------- /ch09/django/myproject/myapp/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/django/myproject/myapp/migrations/__init__.py -------------------------------------------------------------------------------- /ch09/django/myproject/myapp/migrations/__pycache__/__init__.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/django/myproject/myapp/migrations/__pycache__/__init__.cpython-310.pyc -------------------------------------------------------------------------------- /ch09/django/myproject/myapp/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | -------------------------------------------------------------------------------- /ch09/django/myproject/myapp/static/css/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: Arial, sans-serif; 3 | background-color: #f5f5f5; 4 | margin: 0; 5 | padding: 20px; 6 | } 7 | 8 | h1 { 9 | color: #333; 10 | } 11 | 12 | p { 13 | color: #777; 14 | } 15 | 16 | -------------------------------------------------------------------------------- /ch09/django/myproject/myapp/static/fastcampus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/django/myproject/myapp/static/fastcampus.png -------------------------------------------------------------------------------- /ch09/django/myproject/myapp/templates/myapp/index.html: -------------------------------------------------------------------------------- 1 | 2 | {% load static %} 3 | 4 | 5 | Django App 6 | 7 | 8 | 9 |
10 | Fastcampus Logo 11 |

Welcome to Fastcampus - Django App using dockerfile

12 |

This is a sample Django application

13 |
14 | 15 | 16 | -------------------------------------------------------------------------------- /ch09/django/myproject/myapp/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /ch09/django/myproject/myapp/urls.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from django.urls import include, path 3 | from django.conf import settings 4 | from django.conf.urls.static import static 5 | 6 | from .views import hello 7 | 8 | urlpatterns = [ 9 | path('admin/', admin.site.urls), 10 | path('', hello, name='index'), 11 | # ... other URL patterns for your app ... 12 | ] 13 | 14 | # Serve static files during development 15 | if settings.DEBUG: 16 | urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) 17 | 18 | -------------------------------------------------------------------------------- /ch09/django/myproject/myapp/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | 3 | def hello(request): 4 | return render(request, 'myapp/index.html') 5 | 6 | -------------------------------------------------------------------------------- /ch09/django/myproject/urls.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from django.urls import include, path 3 | from django.conf import settings 4 | from django.conf.urls.static import static 5 | 6 | from .views import hello 7 | 8 | urlpatterns = [ 9 | path('admin/', admin.site.urls), 10 | path('', hello, name='index'), 11 | # ... other URL patterns for your app ... 12 | ] 13 | 14 | # Serve static files during development 15 | if settings.DEBUG: 16 | urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) 17 | 18 | -------------------------------------------------------------------------------- /ch09/django/myproject/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | 3 | def hello(request): 4 | return render(request, 'myapp/index.html') 5 | 6 | -------------------------------------------------------------------------------- /ch09/django/myproject/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for myproject project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myproject.settings') 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /ch09/django/requirements.txt: -------------------------------------------------------------------------------- 1 | Django>=3.2 2 | 3 | -------------------------------------------------------------------------------- /ch09/flask/.dockerignore: -------------------------------------------------------------------------------- 1 | Dockerfile 2 | COAI 3 | -------------------------------------------------------------------------------- /ch09/flask/COAI/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM lab1-flask-app:1.0 2 | #WORKDIR /app 3 | COPY requirements.txt . 4 | RUN pip install --no-cache-dir -r requirements.txt 5 | COPY . . 6 | EXPOSE 8000 7 | CMD ["python", "app.py"] 8 | 9 | -------------------------------------------------------------------------------- /ch09/flask/COAI/app.py: -------------------------------------------------------------------------------- 1 | from flask import Flask, render_template 2 | 3 | app = Flask(__name__, template_folder='template') 4 | 5 | @app.route('/') 6 | def index(): 7 | return render_template('index.html') 8 | 9 | if __name__ == '__main__': 10 | app.run(host='0.0.0.0', port=8000) 11 | 12 | -------------------------------------------------------------------------------- /ch09/flask/COAI/requirements.txt: -------------------------------------------------------------------------------- 1 | Flask 2 | -------------------------------------------------------------------------------- /ch09/flask/COAI/static/images/2578773b593fa67420-594x334.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/flask/COAI/static/images/2578773b593fa67420-594x334.webp -------------------------------------------------------------------------------- /ch09/flask/COAI/static/images/3196469-16862104563397-500-500x600.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/flask/COAI/static/images/3196469-16862104563397-500-500x600.webp -------------------------------------------------------------------------------- /ch09/flask/COAI/static/images/3381238-16877504457812-500-500x500.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/flask/COAI/static/images/3381238-16877504457812-500-500x500.webp -------------------------------------------------------------------------------- /ch09/flask/COAI/static/images/detail-2645649-2-500-432x518.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/flask/COAI/static/images/detail-2645649-2-500-432x518.webp -------------------------------------------------------------------------------- /ch09/flask/COAI/static/images/detail-3043508-16765278603381-500-500x600.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/flask/COAI/static/images/detail-3043508-16765278603381-500-500x600.webp -------------------------------------------------------------------------------- /ch09/flask/COAI/static/images/detail-3129731-16817899470786-500-500x600.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/flask/COAI/static/images/detail-3129731-16817899470786-500-500x600.webp -------------------------------------------------------------------------------- /ch09/flask/COAI/static/images/detail-33831-1-500-700x1050.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/flask/COAI/static/images/detail-33831-1-500-700x1050.webp -------------------------------------------------------------------------------- /ch09/flask/COAI/static/images/detail-33849-2-500-700x1050.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/flask/COAI/static/images/detail-33849-2-500-700x1050.webp -------------------------------------------------------------------------------- /ch09/flask/COAI/static/images/detail-33885-2-500-700x1050.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/flask/COAI/static/images/detail-33885-2-500-700x1050.webp -------------------------------------------------------------------------------- /ch09/flask/COAI/static/images/detail-33981-1-500-700x1050.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/flask/COAI/static/images/detail-33981-1-500-700x1050.webp -------------------------------------------------------------------------------- /ch09/flask/COAI/static/images/detail-33982-1-500-700x1050.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/flask/COAI/static/images/detail-33982-1-500-700x1050.webp -------------------------------------------------------------------------------- /ch09/flask/COAI/static/images/detail-33983-1-500-700x1050.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/flask/COAI/static/images/detail-33983-1-500-700x1050.webp -------------------------------------------------------------------------------- /ch09/flask/COAI/static/images/detail-33984-1-500-700x1050.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/flask/COAI/static/images/detail-33984-1-500-700x1050.webp -------------------------------------------------------------------------------- /ch09/flask/COAI/static/images/detail-33991-2-500-700x1050.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/flask/COAI/static/images/detail-33991-2-500-700x1050.webp -------------------------------------------------------------------------------- /ch09/flask/COAI/static/images/detail-34004-6-500-700x1050.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/flask/COAI/static/images/detail-34004-6-500-700x1050.webp -------------------------------------------------------------------------------- /ch09/flask/COAI/static/images/detail-34138-1-500-700x1050.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/flask/COAI/static/images/detail-34138-1-500-700x1050.webp -------------------------------------------------------------------------------- /ch09/flask/COAI/static/images/mbr-121x81.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/flask/COAI/static/images/mbr-121x81.webp -------------------------------------------------------------------------------- /ch09/flask/COAI/static/images/view.staff-6442410278bb8-432x648.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/flask/COAI/static/images/view.staff-6442410278bb8-432x648.webp -------------------------------------------------------------------------------- /ch09/flask/COAI/static/socicon/fonts/socicon.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/flask/COAI/static/socicon/fonts/socicon.eot -------------------------------------------------------------------------------- /ch09/flask/COAI/static/socicon/fonts/socicon.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/flask/COAI/static/socicon/fonts/socicon.ttf -------------------------------------------------------------------------------- /ch09/flask/COAI/static/socicon/fonts/socicon.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/flask/COAI/static/socicon/fonts/socicon.woff -------------------------------------------------------------------------------- /ch09/flask/COAI/static/socicon/fonts/socicon.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/flask/COAI/static/socicon/fonts/socicon.woff2 -------------------------------------------------------------------------------- /ch09/flask/COAI/static/web/assets/mobirise-icons2/mobirise2.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/flask/COAI/static/web/assets/mobirise-icons2/mobirise2.eot -------------------------------------------------------------------------------- /ch09/flask/COAI/static/web/assets/mobirise-icons2/mobirise2.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/flask/COAI/static/web/assets/mobirise-icons2/mobirise2.ttf -------------------------------------------------------------------------------- /ch09/flask/COAI/static/web/assets/mobirise-icons2/mobirise2.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/flask/COAI/static/web/assets/mobirise-icons2/mobirise2.woff -------------------------------------------------------------------------------- /ch09/flask/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.9-slim 2 | WORKDIR /app 3 | COPY requirement.txt . 4 | COPY app/static static 5 | COPY app/template template 6 | COPY app.py . 7 | RUN pip install --no-cache-dir -r requirement.txt 8 | CMD ["python", "app.py"] 9 | 10 | -------------------------------------------------------------------------------- /ch09/flask/app.py: -------------------------------------------------------------------------------- 1 | from flask import Flask, render_template 2 | 3 | app = Flask(__name__, template_folder='template') 4 | 5 | @app.route('/') 6 | def hello(): 7 | return render_template('index.html') 8 | 9 | if __name__ == '__main__': 10 | app.run(host='0.0.0.0', port=8000) 11 | 12 | -------------------------------------------------------------------------------- /ch09/flask/app/static/fastcampus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/flask/app/static/fastcampus.png -------------------------------------------------------------------------------- /ch09/flask/app/static/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: Arial, sans-serif; 3 | background-color: #f5f5f5; 4 | margin: 0; 5 | padding: 20px; 6 | } 7 | 8 | h1 { 9 | color: #333; 10 | } 11 | 12 | p { 13 | color: #777; 14 | } 15 | 16 | -------------------------------------------------------------------------------- /ch09/flask/app/template/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Flask App 5 | 6 | 7 | 8 | Image 9 |

Welcome to Fastcampus - Flask App using dockerfile

10 |

This is a sample Flask application!

11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /ch09/flask/requirement.txt: -------------------------------------------------------------------------------- 1 | numpy 2 | pandas 3 | flask 4 | -------------------------------------------------------------------------------- /ch09/java/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM adoptopenjdk:11-jre-hotspot 2 | 3 | WORKDIR /usr/src/app 4 | 5 | COPY ./target/my-web-app-1.0-SNAPSHOT.jar app.jar 6 | 7 | # Include all dependencies in a lib directory 8 | COPY ./target/dependency/*.jar ./lib/ 9 | COPY ./src/main/resources/static ./static 10 | 11 | #CMD ["java", "-cp", "app.jar:./static/*", "com.example.mywebapp.MainApplication"] 12 | CMD ["java", "-cp", "app.jar:lib/*", "com.example.mywebapp.MainApplication"] 13 | -------------------------------------------------------------------------------- /ch09/java/src/main/java/com/example/App.java: -------------------------------------------------------------------------------- 1 | package com.example; 2 | 3 | /** 4 | * Hello world! 5 | * 6 | */ 7 | public class App 8 | { 9 | public static void main( String[] args ) 10 | { 11 | System.out.println( "Hello World!" ); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ch09/java/src/main/java/com/example/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.mywebapp; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class MainApplication { 8 | public static void main(String[] args) { 9 | SpringApplication.run(MainApplication.class, args); 10 | } 11 | } 12 | 13 | -------------------------------------------------------------------------------- /ch09/java/src/main/resources/static/images/fastcampus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/java/src/main/resources/static/images/fastcampus.png -------------------------------------------------------------------------------- /ch09/java/src/main/resources/static/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | My Java App 6 | 7 | 8 | 9 | fastcampus logo 10 |

Welcome to Fastcampus - Java App using dockerfile

11 |

This is a sample Java application!

12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /ch09/java/src/main/resources/static/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: Arial, sans-serif; 3 | background-color: #f5f5f5; 4 | margin: 0; 5 | padding: 20px; 6 | } 7 | 8 | h1 { 9 | color: #333; 10 | } 11 | 12 | p { 13 | color: #777; 14 | } 15 | 16 | -------------------------------------------------------------------------------- /ch09/java/src/test/java/com/example/AppTest.java: -------------------------------------------------------------------------------- 1 | package com.example; 2 | 3 | import junit.framework.Test; 4 | import junit.framework.TestCase; 5 | import junit.framework.TestSuite; 6 | 7 | /** 8 | * Unit test for simple App. 9 | */ 10 | public class AppTest 11 | extends TestCase 12 | { 13 | /** 14 | * Create the test case 15 | * 16 | * @param testName name of the test case 17 | */ 18 | public AppTest( String testName ) 19 | { 20 | super( testName ); 21 | } 22 | 23 | /** 24 | * @return the suite of tests being tested 25 | */ 26 | public static Test suite() 27 | { 28 | return new TestSuite( AppTest.class ); 29 | } 30 | 31 | /** 32 | * Rigourous Test :-) 33 | */ 34 | public void testApp() 35 | { 36 | assertTrue( true ); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /ch09/java/target/classes/com/example/App.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/java/target/classes/com/example/App.class -------------------------------------------------------------------------------- /ch09/java/target/classes/com/example/mywebapp/MainApplication.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/java/target/classes/com/example/mywebapp/MainApplication.class -------------------------------------------------------------------------------- /ch09/java/target/classes/static/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | My Java App 6 | 7 | 8 | 9 | fastcampus logo 10 |

Welcome to Fastcampus - Java App using dockerfile

11 |

This is a sample Java application!

12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /ch09/java/target/classes/static/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: Arial, sans-serif; 3 | background-color: #f5f5f5; 4 | margin: 0; 5 | padding: 20px; 6 | } 7 | 8 | h1 { 9 | color: #333; 10 | } 11 | 12 | p { 13 | color: #777; 14 | } 15 | 16 | -------------------------------------------------------------------------------- /ch09/java/target/dependency/jackson-annotations-2.12.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/java/target/dependency/jackson-annotations-2.12.3.jar -------------------------------------------------------------------------------- /ch09/java/target/dependency/jackson-core-2.12.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/java/target/dependency/jackson-core-2.12.3.jar -------------------------------------------------------------------------------- /ch09/java/target/dependency/jackson-databind-2.12.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/java/target/dependency/jackson-databind-2.12.3.jar -------------------------------------------------------------------------------- /ch09/java/target/dependency/jackson-datatype-jdk8-2.12.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/java/target/dependency/jackson-datatype-jdk8-2.12.3.jar -------------------------------------------------------------------------------- /ch09/java/target/dependency/jackson-datatype-jsr310-2.12.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/java/target/dependency/jackson-datatype-jsr310-2.12.3.jar -------------------------------------------------------------------------------- /ch09/java/target/dependency/jackson-module-parameter-names-2.12.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/java/target/dependency/jackson-module-parameter-names-2.12.3.jar -------------------------------------------------------------------------------- /ch09/java/target/dependency/jakarta.annotation-api-1.3.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/java/target/dependency/jakarta.annotation-api-1.3.5.jar -------------------------------------------------------------------------------- /ch09/java/target/dependency/jul-to-slf4j-1.7.31.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/java/target/dependency/jul-to-slf4j-1.7.31.jar -------------------------------------------------------------------------------- /ch09/java/target/dependency/junit-3.8.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/java/target/dependency/junit-3.8.1.jar -------------------------------------------------------------------------------- /ch09/java/target/dependency/log4j-api-2.14.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/java/target/dependency/log4j-api-2.14.1.jar -------------------------------------------------------------------------------- /ch09/java/target/dependency/log4j-to-slf4j-2.14.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/java/target/dependency/log4j-to-slf4j-2.14.1.jar -------------------------------------------------------------------------------- /ch09/java/target/dependency/logback-classic-1.2.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/java/target/dependency/logback-classic-1.2.3.jar -------------------------------------------------------------------------------- /ch09/java/target/dependency/logback-core-1.2.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/java/target/dependency/logback-core-1.2.3.jar -------------------------------------------------------------------------------- /ch09/java/target/dependency/slf4j-api-1.7.25.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/java/target/dependency/slf4j-api-1.7.25.jar -------------------------------------------------------------------------------- /ch09/java/target/dependency/snakeyaml-1.28.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/java/target/dependency/snakeyaml-1.28.jar -------------------------------------------------------------------------------- /ch09/java/target/dependency/spring-aop-5.3.8.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/java/target/dependency/spring-aop-5.3.8.jar -------------------------------------------------------------------------------- /ch09/java/target/dependency/spring-beans-5.3.8.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/java/target/dependency/spring-beans-5.3.8.jar -------------------------------------------------------------------------------- /ch09/java/target/dependency/spring-boot-2.5.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/java/target/dependency/spring-boot-2.5.2.jar -------------------------------------------------------------------------------- /ch09/java/target/dependency/spring-boot-autoconfigure-2.5.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/java/target/dependency/spring-boot-autoconfigure-2.5.2.jar -------------------------------------------------------------------------------- /ch09/java/target/dependency/spring-boot-starter-2.5.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/java/target/dependency/spring-boot-starter-2.5.2.jar -------------------------------------------------------------------------------- /ch09/java/target/dependency/spring-boot-starter-json-2.5.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/java/target/dependency/spring-boot-starter-json-2.5.2.jar -------------------------------------------------------------------------------- /ch09/java/target/dependency/spring-boot-starter-logging-2.5.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/java/target/dependency/spring-boot-starter-logging-2.5.2.jar -------------------------------------------------------------------------------- /ch09/java/target/dependency/spring-boot-starter-tomcat-2.5.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/java/target/dependency/spring-boot-starter-tomcat-2.5.2.jar -------------------------------------------------------------------------------- /ch09/java/target/dependency/spring-boot-starter-web-2.5.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/java/target/dependency/spring-boot-starter-web-2.5.2.jar -------------------------------------------------------------------------------- /ch09/java/target/dependency/spring-context-5.3.8.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/java/target/dependency/spring-context-5.3.8.jar -------------------------------------------------------------------------------- /ch09/java/target/dependency/spring-core-5.3.8.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/java/target/dependency/spring-core-5.3.8.jar -------------------------------------------------------------------------------- /ch09/java/target/dependency/spring-expression-5.3.8.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/java/target/dependency/spring-expression-5.3.8.jar -------------------------------------------------------------------------------- /ch09/java/target/dependency/spring-jcl-5.3.8.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/java/target/dependency/spring-jcl-5.3.8.jar -------------------------------------------------------------------------------- /ch09/java/target/dependency/spring-web-5.3.8.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/java/target/dependency/spring-web-5.3.8.jar -------------------------------------------------------------------------------- /ch09/java/target/dependency/spring-webmvc-5.3.8.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/java/target/dependency/spring-webmvc-5.3.8.jar -------------------------------------------------------------------------------- /ch09/java/target/dependency/tomcat-embed-core-9.0.48.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/java/target/dependency/tomcat-embed-core-9.0.48.jar -------------------------------------------------------------------------------- /ch09/java/target/dependency/tomcat-embed-el-9.0.48.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/java/target/dependency/tomcat-embed-el-9.0.48.jar -------------------------------------------------------------------------------- /ch09/java/target/dependency/tomcat-embed-websocket-9.0.48.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/java/target/dependency/tomcat-embed-websocket-9.0.48.jar -------------------------------------------------------------------------------- /ch09/java/target/maven-archiver/pom.properties: -------------------------------------------------------------------------------- 1 | artifactId=my-web-app 2 | groupId=com.example 3 | version=1.0-SNAPSHOT 4 | -------------------------------------------------------------------------------- /ch09/java/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst: -------------------------------------------------------------------------------- 1 | com/example/mywebapp/MainApplication.class 2 | com/example/App.class 3 | -------------------------------------------------------------------------------- /ch09/java/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst: -------------------------------------------------------------------------------- 1 | /home/kevin/examples-dockerfile/java2/my-web-app/src/main/java/com/example/App.java 2 | /home/kevin/examples-dockerfile/java2/my-web-app/src/main/java/com/example/MainApplication.java 3 | -------------------------------------------------------------------------------- /ch09/java/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst: -------------------------------------------------------------------------------- 1 | com/example/AppTest.class 2 | -------------------------------------------------------------------------------- /ch09/java/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst: -------------------------------------------------------------------------------- 1 | /home/kevin/examples-dockerfile/java2/my-web-app/src/test/java/com/example/AppTest.java 2 | -------------------------------------------------------------------------------- /ch09/java/target/my-web-app-1.0-SNAPSHOT.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/java/target/my-web-app-1.0-SNAPSHOT.jar -------------------------------------------------------------------------------- /ch09/java/target/surefire-reports/com.example.AppTest.txt: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------- 2 | Test set: com.example.AppTest 3 | ------------------------------------------------------------------------------- 4 | Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.009 sec 5 | -------------------------------------------------------------------------------- /ch09/java/target/test-classes/com/example/AppTest.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/java/target/test-classes/com/example/AppTest.class -------------------------------------------------------------------------------- /ch09/lightweight1/dockerfile-myweb1: -------------------------------------------------------------------------------- 1 | FROM ubuntu:20.04 2 | MAINTAINER "kevin-lee " 3 | LABEL "purpose"="webserver practice" 4 | RUN apt-get update && apt-get install apache2 -y 5 | WORKDIR /var/www/html 6 | ADD index.html . 7 | EXPOSE 80 8 | CMD apachectl -D FOREGROUND 9 | -------------------------------------------------------------------------------- /ch09/lightweight1/dockerfile-myweb2: -------------------------------------------------------------------------------- 1 | FROM ubuntu:20.04 2 | MAINTAINER "kevin-lee " 3 | LABEL "purpose"="webserver practice" 4 | RUN apt-get update && apt-get install apache2 -y && \ 5 | apt-get clean -y && \ 6 | apt-get autoremove -y && \ 7 | rm -rfv /tmp/* /var/lib/apt/lists/* /var/tmp/* 8 | WORKDIR /var/www/html 9 | ADD index.html . 10 | EXPOSE 80 11 | CMD apachectl -D FOREGROUND 12 | -------------------------------------------------------------------------------- /ch09/lightweight1/dockerfile-myweb3: -------------------------------------------------------------------------------- 1 | FROM alpine 2 | MAINTAINER "kevin-lee " 3 | LABEL "purpose"="webserver practice" 4 | RUN apk update && apk add apache2 5 | WORKDIR /var/www/html 6 | ADD index.html . 7 | EXPOSE 80 8 | CMD ["/usr/sbin/httpd","-D","FOREGROUND"] 9 | -------------------------------------------------------------------------------- /ch09/lightweight2/busybox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/lightweight2/busybox -------------------------------------------------------------------------------- /ch09/lightweight2/dockerfile-scratch: -------------------------------------------------------------------------------- 1 | FROM scratch 2 | COPY go-to-lightweight-image / 3 | CMD ["/go-to-lightweight-image"] 4 | -------------------------------------------------------------------------------- /ch09/lightweight2/dockerfile-ubuntu: -------------------------------------------------------------------------------- 1 | FROM ubuntu:20.04 2 | COPY go-to-lightweight-image / 3 | CMD /go-to-lightweight-image 4 | -------------------------------------------------------------------------------- /ch09/lightweight2/go-to-lightweight-image: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/lightweight2/go-to-lightweight-image -------------------------------------------------------------------------------- /ch09/lightweight2/go-to-lightweight-image.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | printf("Go to lightweight image!\n"); 5 | return 0; 6 | } 7 | -------------------------------------------------------------------------------- /ch09/lightweight2/rootfs.tar.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/lightweight2/rootfs.tar.xz -------------------------------------------------------------------------------- /ch09/multi-stage/appstart.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo "Best image build, multi stage build!" 3 | -------------------------------------------------------------------------------- /ch09/multi-stage/dockerfile-app1: -------------------------------------------------------------------------------- 1 | FROM ubuntu:20.04 2 | RUN apt-get update -y && apt-get install nginx -y 3 | COPY appstart.sh / 4 | RUN useradd kevin 5 | USER kevin 6 | ENTRYPOINT ["/appstart.sh"] 7 | 8 | -------------------------------------------------------------------------------- /ch09/multi-stage/dockerfile-app2: -------------------------------------------------------------------------------- 1 | FROM ubuntu:20.04 as v1-stage 2 | RUN apt-get update && apt-get install nginx -y 3 | WORKDIR /app 4 | COPY appstart.sh /app 5 | 6 | FROM alpine:3.12.1 7 | RUN addgroup -S appgroup && adduser -S kevin -G appgroup -h /home/kevin 8 | COPY --from=v1-stage /app /home/kevin 9 | USER kevin 10 | ENTRYPOINT ["sh","/home/kevin/appstart.sh"] 11 | -------------------------------------------------------------------------------- /ch09/multi-stage/dockerfile-go1: -------------------------------------------------------------------------------- 1 | FROM golang:1.15-alpine3.12 2 | WORKDIR /app/ 3 | COPY gostart.go /app/ 4 | RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /app/gostart 5 | ENTRYPOINT [ "/app/gostart" ] 6 | -------------------------------------------------------------------------------- /ch09/multi-stage/dockerfile-go2: -------------------------------------------------------------------------------- 1 | FROM golang:1.15-alpine3.12 AS gobuilder-stage 2 | MAINTAINER kevin,lee 3 | LABEL "purpose"="Application Deployment using Multi-stage builds." 4 | WORKDIR /app/ 5 | COPY gostart.go /app/ 6 | RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /app/gostart 7 | 8 | FROM scratch 9 | COPY --from=gobuilder-stage /app/gostart /app/gostart 10 | CMD ["/app/gostart"] 11 | -------------------------------------------------------------------------------- /ch09/multi-stage/gostart.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | "log" 7 | "net" 8 | "net/http" 9 | ) 10 | func handler(w http.ResponseWriter, r *http.Request){ 11 | name, err := os.Hostname() 12 | if err != nil { 13 | fmt.Printf("error: %v\n", err) 14 | return 15 | } 16 | fmt.Fprintln(w, "hostname: ", name) 17 | 18 | addr, err := net.LookupHost(name) 19 | if err != nil { 20 | fmt.Printf("error: %v\n", err) 21 | return 22 | } 23 | fmt.Fprintln(w, "IP: ", addr) 24 | 25 | for _, a := range addr { 26 | fmt.Println(a) 27 | } 28 | } 29 | func main() { 30 | fmt.Fprintln(os.Stdout, "Go!!! Go Application ......") 31 | http.HandleFunc("/",handler) 32 | log.Fatal(http.ListenAndServe(":9090",nil)) 33 | } 34 | -------------------------------------------------------------------------------- /ch09/nodejs/.dockerignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | npm-debug.log 3 | -------------------------------------------------------------------------------- /ch09/nodejs/Dockerfile: -------------------------------------------------------------------------------- 1 | # Use an official Node.js runtime as the base image 2 | FROM node:20-alpine 3 | 4 | # Set the working directory in the container 5 | WORKDIR /usr/src/app 6 | 7 | # Copy package.json and package-lock.json to the working directory 8 | COPY package*.json ./ 9 | 10 | # Install project dependencies 11 | RUN npm install 12 | 13 | # Copy the rest of the application code 14 | COPY . . 15 | 16 | # Expose the application port 17 | EXPOSE 3000 18 | 19 | # Start the application 20 | CMD ["node", "server.js"] 21 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/array-flatten/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "array-flatten", 3 | "version": "1.1.1", 4 | "description": "Flatten an array of nested arrays into a single flat array", 5 | "main": "array-flatten.js", 6 | "files": [ 7 | "array-flatten.js", 8 | "LICENSE" 9 | ], 10 | "scripts": { 11 | "test": "istanbul cover _mocha -- -R spec" 12 | }, 13 | "repository": { 14 | "type": "git", 15 | "url": "git://github.com/blakeembrey/array-flatten.git" 16 | }, 17 | "keywords": [ 18 | "array", 19 | "flatten", 20 | "arguments", 21 | "depth" 22 | ], 23 | "author": { 24 | "name": "Blake Embrey", 25 | "email": "hello@blakeembrey.com", 26 | "url": "http://blakeembrey.me" 27 | }, 28 | "license": "MIT", 29 | "bugs": { 30 | "url": "https://github.com/blakeembrey/array-flatten/issues" 31 | }, 32 | "homepage": "https://github.com/blakeembrey/array-flatten", 33 | "devDependencies": { 34 | "istanbul": "^0.3.13", 35 | "mocha": "^2.2.4", 36 | "pre-commit": "^1.0.7", 37 | "standard": "^3.7.3" 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/bytes/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bytes", 3 | "description": "Utility to parse a string bytes to bytes and vice-versa", 4 | "version": "3.1.2", 5 | "author": "TJ Holowaychuk (http://tjholowaychuk.com)", 6 | "contributors": [ 7 | "Jed Watson ", 8 | "Théo FIDRY " 9 | ], 10 | "license": "MIT", 11 | "keywords": [ 12 | "byte", 13 | "bytes", 14 | "utility", 15 | "parse", 16 | "parser", 17 | "convert", 18 | "converter" 19 | ], 20 | "repository": "visionmedia/bytes.js", 21 | "devDependencies": { 22 | "eslint": "7.32.0", 23 | "eslint-plugin-markdown": "2.2.1", 24 | "mocha": "9.2.0", 25 | "nyc": "15.1.0" 26 | }, 27 | "files": [ 28 | "History.md", 29 | "LICENSE", 30 | "Readme.md", 31 | "index.js" 32 | ], 33 | "engines": { 34 | "node": ">= 0.8" 35 | }, 36 | "scripts": { 37 | "lint": "eslint .", 38 | "test": "mocha --check-leaks --reporter spec", 39 | "test-ci": "nyc --reporter=lcov --reporter=text npm test", 40 | "test-cov": "nyc --reporter=html --reporter=text npm test" 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/call-bind/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Jordan Harband 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/call-bind/README.md: -------------------------------------------------------------------------------- 1 | # call-bind 2 | Robustly `.call.bind()` a function. 3 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/call-bind/callBound.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var GetIntrinsic = require('get-intrinsic'); 4 | 5 | var callBind = require('./'); 6 | 7 | var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf')); 8 | 9 | module.exports = function callBoundIntrinsic(name, allowMissing) { 10 | var intrinsic = GetIntrinsic(name, !!allowMissing); 11 | if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) { 12 | return callBind(intrinsic); 13 | } 14 | return intrinsic; 15 | }; 16 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/content-type/HISTORY.md: -------------------------------------------------------------------------------- 1 | 1.0.5 / 2023-01-29 2 | ================== 3 | 4 | * perf: skip value escaping when unnecessary 5 | 6 | 1.0.4 / 2017-09-11 7 | ================== 8 | 9 | * perf: skip parameter parsing when no parameters 10 | 11 | 1.0.3 / 2017-09-10 12 | ================== 13 | 14 | * perf: remove argument reassignment 15 | 16 | 1.0.2 / 2016-05-09 17 | ================== 18 | 19 | * perf: enable strict mode 20 | 21 | 1.0.1 / 2015-02-13 22 | ================== 23 | 24 | * Improve missing `Content-Type` header error message 25 | 26 | 1.0.0 / 2015-02-01 27 | ================== 28 | 29 | * Initial implementation, derived from `media-typer@0.3.0` 30 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/content-type/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2015 Douglas Christopher Wilson 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | 'Software'), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/cookie-signature/History.md: -------------------------------------------------------------------------------- 1 | 1.0.6 / 2015-02-03 2 | ================== 3 | 4 | * use `npm test` instead of `make test` to run tests 5 | * clearer assertion messages when checking input 6 | 7 | 8 | 1.0.5 / 2014-09-05 9 | ================== 10 | 11 | * add license to package.json 12 | 13 | 1.0.4 / 2014-06-25 14 | ================== 15 | 16 | * corrected avoidance of timing attacks (thanks @tenbits!) 17 | 18 | 1.0.3 / 2014-01-28 19 | ================== 20 | 21 | * [incorrect] fix for timing attacks 22 | 23 | 1.0.2 / 2014-01-28 24 | ================== 25 | 26 | * fix missing repository warning 27 | * fix typo in test 28 | 29 | 1.0.1 / 2013-04-15 30 | ================== 31 | 32 | * Revert "Changed underlying HMAC algo. to sha512." 33 | * Revert "Fix for timing attacks on MAC verification." 34 | 35 | 0.0.1 / 2010-01-03 36 | ================== 37 | 38 | * Initial release 39 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/cookie-signature/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cookie-signature", 3 | "version": "1.0.6", 4 | "description": "Sign and unsign cookies", 5 | "keywords": ["cookie", "sign", "unsign"], 6 | "author": "TJ Holowaychuk ", 7 | "license": "MIT", 8 | "repository": { "type": "git", "url": "https://github.com/visionmedia/node-cookie-signature.git"}, 9 | "dependencies": {}, 10 | "devDependencies": { 11 | "mocha": "*", 12 | "should": "*" 13 | }, 14 | "scripts": { 15 | "test": "mocha --require should --reporter spec" 16 | }, 17 | "main": "index" 18 | } 19 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/debug/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2014 TJ Holowaychuk 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software 6 | and associated documentation files (the 'Software'), to deal in the Software without restriction, 7 | including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 9 | subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all copies or substantial 12 | portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 15 | LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 16 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 17 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 18 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | 20 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/debug/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "debug", 3 | "repo": "visionmedia/debug", 4 | "description": "small debugging utility", 5 | "version": "2.6.9", 6 | "keywords": [ 7 | "debug", 8 | "log", 9 | "debugger" 10 | ], 11 | "main": "src/browser.js", 12 | "scripts": [ 13 | "src/browser.js", 14 | "src/debug.js" 15 | ], 16 | "dependencies": { 17 | "rauchg/ms.js": "0.7.1" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/debug/node.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./src/node'); 2 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/debug/src/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Detect Electron renderer process, which is node, but we should 3 | * treat as a browser. 4 | */ 5 | 6 | if (typeof process !== 'undefined' && process.type === 'renderer') { 7 | module.exports = require('./browser.js'); 8 | } else { 9 | module.exports = require('./node.js'); 10 | } 11 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/debug/src/inspector-log.js: -------------------------------------------------------------------------------- 1 | module.exports = inspectorLog; 2 | 3 | // black hole 4 | const nullStream = new (require('stream').Writable)(); 5 | nullStream._write = () => {}; 6 | 7 | /** 8 | * Outputs a `console.log()` to the Node.js Inspector console *only*. 9 | */ 10 | function inspectorLog() { 11 | const stdout = console._stdout; 12 | console._stdout = nullStream; 13 | console.log.apply(console, arguments); 14 | console._stdout = stdout; 15 | } 16 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/depd/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2014-2018 Douglas Christopher Wilson 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | 'Software'), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/ee-first/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ee-first", 3 | "description": "return the first event in a set of ee/event pairs", 4 | "version": "1.1.1", 5 | "author": { 6 | "name": "Jonathan Ong", 7 | "email": "me@jongleberry.com", 8 | "url": "http://jongleberry.com", 9 | "twitter": "https://twitter.com/jongleberry" 10 | }, 11 | "contributors": [ 12 | "Douglas Christopher Wilson " 13 | ], 14 | "license": "MIT", 15 | "repository": "jonathanong/ee-first", 16 | "devDependencies": { 17 | "istanbul": "0.3.9", 18 | "mocha": "2.2.5" 19 | }, 20 | "files": [ 21 | "index.js", 22 | "LICENSE" 23 | ], 24 | "scripts": { 25 | "test": "mocha --reporter spec --bail --check-leaks test/", 26 | "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", 27 | "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/encodeurl/HISTORY.md: -------------------------------------------------------------------------------- 1 | 1.0.2 / 2018-01-21 2 | ================== 3 | 4 | * Fix encoding `%` as last character 5 | 6 | 1.0.1 / 2016-06-09 7 | ================== 8 | 9 | * Fix encoding unpaired surrogates at start/end of string 10 | 11 | 1.0.0 / 2016-06-08 12 | ================== 13 | 14 | * Initial release 15 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/encodeurl/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2016 Douglas Christopher Wilson 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | 'Software'), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/escape-html/Readme.md: -------------------------------------------------------------------------------- 1 | 2 | # escape-html 3 | 4 | Escape string for use in HTML 5 | 6 | ## Example 7 | 8 | ```js 9 | var escape = require('escape-html'); 10 | var html = escape('foo & bar'); 11 | // -> foo & bar 12 | ``` 13 | 14 | ## Benchmark 15 | 16 | ``` 17 | $ npm run-script bench 18 | 19 | > escape-html@1.0.3 bench nodejs-escape-html 20 | > node benchmark/index.js 21 | 22 | 23 | http_parser@1.0 24 | node@0.10.33 25 | v8@3.14.5.9 26 | ares@1.9.0-DEV 27 | uv@0.10.29 28 | zlib@1.2.3 29 | modules@11 30 | openssl@1.0.1j 31 | 32 | 1 test completed. 33 | 2 tests completed. 34 | 3 tests completed. 35 | 36 | no special characters x 19,435,271 ops/sec ±0.85% (187 runs sampled) 37 | single special character x 6,132,421 ops/sec ±0.67% (194 runs sampled) 38 | many special characters x 3,175,826 ops/sec ±0.65% (193 runs sampled) 39 | ``` 40 | 41 | ## License 42 | 43 | MIT -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/escape-html/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "escape-html", 3 | "description": "Escape string for use in HTML", 4 | "version": "1.0.3", 5 | "license": "MIT", 6 | "keywords": [ 7 | "escape", 8 | "html", 9 | "utility" 10 | ], 11 | "repository": "component/escape-html", 12 | "devDependencies": { 13 | "benchmark": "1.0.0", 14 | "beautify-benchmark": "0.2.4" 15 | }, 16 | "files": [ 17 | "LICENSE", 18 | "Readme.md", 19 | "index.js" 20 | ], 21 | "scripts": { 22 | "bench": "node benchmark/index.js" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/etag/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2014-2016 Douglas Christopher Wilson 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | 'Software'), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/express/index.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * express 3 | * Copyright(c) 2009-2013 TJ Holowaychuk 4 | * Copyright(c) 2013 Roman Shtylman 5 | * Copyright(c) 2014-2015 Douglas Christopher Wilson 6 | * MIT Licensed 7 | */ 8 | 9 | 'use strict'; 10 | 11 | module.exports = require('./lib/express'); 12 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/express/lib/middleware/init.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * express 3 | * Copyright(c) 2009-2013 TJ Holowaychuk 4 | * Copyright(c) 2013 Roman Shtylman 5 | * Copyright(c) 2014-2015 Douglas Christopher Wilson 6 | * MIT Licensed 7 | */ 8 | 9 | 'use strict'; 10 | 11 | /** 12 | * Module dependencies. 13 | * @private 14 | */ 15 | 16 | var setPrototypeOf = require('setprototypeof') 17 | 18 | /** 19 | * Initialization middleware, exposing the 20 | * request and response to each other, as well 21 | * as defaulting the X-Powered-By header field. 22 | * 23 | * @param {Function} app 24 | * @return {Function} 25 | * @api private 26 | */ 27 | 28 | exports.init = function(app){ 29 | return function expressInit(req, res, next){ 30 | if (app.enabled('x-powered-by')) res.setHeader('X-Powered-By', 'Express'); 31 | req.res = res; 32 | res.req = req; 33 | req.next = next; 34 | 35 | setPrototypeOf(req, app.request) 36 | setPrototypeOf(res, app.response) 37 | 38 | res.locals = res.locals || Object.create(null); 39 | 40 | next(); 41 | }; 42 | }; 43 | 44 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/express/lib/middleware/query.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * express 3 | * Copyright(c) 2009-2013 TJ Holowaychuk 4 | * Copyright(c) 2013 Roman Shtylman 5 | * Copyright(c) 2014-2015 Douglas Christopher Wilson 6 | * MIT Licensed 7 | */ 8 | 9 | 'use strict'; 10 | 11 | /** 12 | * Module dependencies. 13 | */ 14 | 15 | var merge = require('utils-merge') 16 | var parseUrl = require('parseurl'); 17 | var qs = require('qs'); 18 | 19 | /** 20 | * @param {Object} options 21 | * @return {Function} 22 | * @api public 23 | */ 24 | 25 | module.exports = function query(options) { 26 | var opts = merge({}, options) 27 | var queryparse = qs.parse; 28 | 29 | if (typeof options === 'function') { 30 | queryparse = options; 31 | opts = undefined; 32 | } 33 | 34 | if (opts !== undefined && opts.allowPrototypes === undefined) { 35 | // back-compat for qs module 36 | opts.allowPrototypes = true; 37 | } 38 | 39 | return function query(req, res, next){ 40 | if (!req.query) { 41 | var val = parseUrl(req).query; 42 | req.query = queryparse(val, opts); 43 | } 44 | 45 | next(); 46 | }; 47 | }; 48 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/forwarded/HISTORY.md: -------------------------------------------------------------------------------- 1 | 0.2.0 / 2021-05-31 2 | ================== 3 | 4 | * Use `req.socket` over deprecated `req.connection` 5 | 6 | 0.1.2 / 2017-09-14 7 | ================== 8 | 9 | * perf: improve header parsing 10 | * perf: reduce overhead when no `X-Forwarded-For` header 11 | 12 | 0.1.1 / 2017-09-10 13 | ================== 14 | 15 | * Fix trimming leading / trailing OWS 16 | * perf: hoist regular expression 17 | 18 | 0.1.0 / 2014-09-21 19 | ================== 20 | 21 | * Initial release 22 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/forwarded/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2014-2017 Douglas Christopher Wilson 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | 'Software'), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/function-bind/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Raynos. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | 21 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/function-bind/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var implementation = require('./implementation'); 4 | 5 | module.exports = Function.prototype.bind || implementation; 6 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/get-intrinsic/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Jordan Harband 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/has-proto/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Inspect JS 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/has-proto/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var test = { 4 | foo: {} 5 | }; 6 | 7 | var $Object = Object; 8 | 9 | module.exports = function hasProto() { 10 | return { __proto__: test }.foo === test.foo && !({ __proto__: null } instanceof $Object); 11 | }; 12 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/has-proto/test/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var test = require('tape'); 4 | var hasProto = require('../'); 5 | 6 | test('hasProto', function (t) { 7 | var result = hasProto(); 8 | t.equal(typeof result, 'boolean', 'returns a boolean (' + result + ')'); 9 | 10 | var obj = { __proto__: null }; 11 | if (result) { 12 | t.notOk('toString' in obj, 'null object lacks toString'); 13 | } else { 14 | t.ok('toString' in obj, 'without proto, null object has toString'); 15 | t.equal(obj.__proto__, null); // eslint-disable-line no-proto 16 | } 17 | 18 | t.end(); 19 | }); 20 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/has-symbols/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Jordan Harband 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/has-symbols/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var origSymbol = typeof Symbol !== 'undefined' && Symbol; 4 | var hasSymbolSham = require('./shams'); 5 | 6 | module.exports = function hasNativeSymbols() { 7 | if (typeof origSymbol !== 'function') { return false; } 8 | if (typeof Symbol !== 'function') { return false; } 9 | if (typeof origSymbol('foo') !== 'symbol') { return false; } 10 | if (typeof Symbol('bar') !== 'symbol') { return false; } 11 | 12 | return hasSymbolSham(); 13 | }; 14 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/has-symbols/test/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var test = require('tape'); 4 | var hasSymbols = require('../'); 5 | var runSymbolTests = require('./tests'); 6 | 7 | test('interface', function (t) { 8 | t.equal(typeof hasSymbols, 'function', 'is a function'); 9 | t.equal(typeof hasSymbols(), 'boolean', 'returns a boolean'); 10 | t.end(); 11 | }); 12 | 13 | test('Symbols are supported', { skip: !hasSymbols() }, function (t) { 14 | runSymbolTests(t); 15 | t.end(); 16 | }); 17 | 18 | test('Symbols are not supported', { skip: hasSymbols() }, function (t) { 19 | t.equal(typeof Symbol, 'undefined', 'global Symbol is undefined'); 20 | t.equal(typeof Object.getOwnPropertySymbols, 'undefined', 'Object.getOwnPropertySymbols does not exist'); 21 | t.end(); 22 | }); 23 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/has-symbols/test/shams/core-js.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var test = require('tape'); 4 | 5 | if (typeof Symbol === 'function' && typeof Symbol() === 'symbol') { 6 | test('has native Symbol support', function (t) { 7 | t.equal(typeof Symbol, 'function'); 8 | t.equal(typeof Symbol(), 'symbol'); 9 | t.end(); 10 | }); 11 | return; 12 | } 13 | 14 | var hasSymbols = require('../../shams'); 15 | 16 | test('polyfilled Symbols', function (t) { 17 | /* eslint-disable global-require */ 18 | t.equal(hasSymbols(), false, 'hasSymbols is false before polyfilling'); 19 | require('core-js/fn/symbol'); 20 | require('core-js/fn/symbol/to-string-tag'); 21 | 22 | require('../tests')(t); 23 | 24 | var hasSymbolsAfter = hasSymbols(); 25 | t.equal(hasSymbolsAfter, true, 'hasSymbols is true after polyfilling'); 26 | /* eslint-enable global-require */ 27 | t.end(); 28 | }); 29 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/has-symbols/test/shams/get-own-property-symbols.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var test = require('tape'); 4 | 5 | if (typeof Symbol === 'function' && typeof Symbol() === 'symbol') { 6 | test('has native Symbol support', function (t) { 7 | t.equal(typeof Symbol, 'function'); 8 | t.equal(typeof Symbol(), 'symbol'); 9 | t.end(); 10 | }); 11 | return; 12 | } 13 | 14 | var hasSymbols = require('../../shams'); 15 | 16 | test('polyfilled Symbols', function (t) { 17 | /* eslint-disable global-require */ 18 | t.equal(hasSymbols(), false, 'hasSymbols is false before polyfilling'); 19 | 20 | require('get-own-property-symbols'); 21 | 22 | require('../tests')(t); 23 | 24 | var hasSymbolsAfter = hasSymbols(); 25 | t.equal(hasSymbolsAfter, true, 'hasSymbols is true after polyfilling'); 26 | /* eslint-enable global-require */ 27 | t.end(); 28 | }); 29 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/has/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Thiago de Arruda 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/has/README.md: -------------------------------------------------------------------------------- 1 | # has 2 | 3 | > Object.prototype.hasOwnProperty.call shortcut 4 | 5 | ## Installation 6 | 7 | ```sh 8 | npm install --save has 9 | ``` 10 | 11 | ## Usage 12 | 13 | ```js 14 | var has = require('has'); 15 | 16 | has({}, 'hasOwnProperty'); // false 17 | has(Object.prototype, 'hasOwnProperty'); // true 18 | ``` 19 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/has/src/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var bind = require('function-bind'); 4 | 5 | module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty); 6 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/has/test/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var test = require('tape'); 4 | var has = require('../'); 5 | 6 | test('has', function (t) { 7 | t.equal(has({}, 'hasOwnProperty'), false, 'object literal does not have own property "hasOwnProperty"'); 8 | t.equal(has(Object.prototype, 'hasOwnProperty'), true, 'Object.prototype has own property "hasOwnProperty"'); 9 | t.end(); 10 | }); 11 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/iconv-lite/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011 Alexander Shtuchkin 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/iconv-lite/encodings/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | // Update this array if you add/rename/remove files in this directory. 4 | // We support Browserify by skipping automatic module discovery and requiring modules directly. 5 | var modules = [ 6 | require("./internal"), 7 | require("./utf16"), 8 | require("./utf7"), 9 | require("./sbcs-codec"), 10 | require("./sbcs-data"), 11 | require("./sbcs-data-generated"), 12 | require("./dbcs-codec"), 13 | require("./dbcs-data"), 14 | ]; 15 | 16 | // Put all encoding/alias/codec definitions to single object and export it. 17 | for (var i = 0; i < modules.length; i++) { 18 | var module = modules[i]; 19 | for (var enc in module) 20 | if (Object.prototype.hasOwnProperty.call(module, enc)) 21 | exports[enc] = module[enc]; 22 | } 23 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/iconv-lite/lib/index.d.ts: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. 4 | * REQUIREMENT: This definition is dependent on the @types/node definition. 5 | * Install with `npm install @types/node --save-dev` 6 | *--------------------------------------------------------------------------------------------*/ 7 | 8 | declare module 'iconv-lite' { 9 | export function decode(buffer: Buffer, encoding: string, options?: Options): string; 10 | 11 | export function encode(content: string, encoding: string, options?: Options): Buffer; 12 | 13 | export function encodingExists(encoding: string): boolean; 14 | 15 | export function decodeStream(encoding: string, options?: Options): NodeJS.ReadWriteStream; 16 | 17 | export function encodeStream(encoding: string, options?: Options): NodeJS.ReadWriteStream; 18 | } 19 | 20 | export interface Options { 21 | stripBOM?: boolean; 22 | addBOM?: boolean; 23 | defaultEncoding?: string; 24 | } 25 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/inherits/LICENSE: -------------------------------------------------------------------------------- 1 | The ISC License 2 | 3 | Copyright (c) Isaac Z. Schlueter 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 10 | REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND 11 | FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 12 | INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 13 | LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 14 | OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 15 | PERFORMANCE OF THIS SOFTWARE. 16 | 17 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/inherits/inherits.js: -------------------------------------------------------------------------------- 1 | try { 2 | var util = require('util'); 3 | /* istanbul ignore next */ 4 | if (typeof util.inherits !== 'function') throw ''; 5 | module.exports = util.inherits; 6 | } catch (e) { 7 | /* istanbul ignore next */ 8 | module.exports = require('./inherits_browser.js'); 9 | } 10 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/inherits/inherits_browser.js: -------------------------------------------------------------------------------- 1 | if (typeof Object.create === 'function') { 2 | // implementation from standard node.js 'util' module 3 | module.exports = function inherits(ctor, superCtor) { 4 | if (superCtor) { 5 | ctor.super_ = superCtor 6 | ctor.prototype = Object.create(superCtor.prototype, { 7 | constructor: { 8 | value: ctor, 9 | enumerable: false, 10 | writable: true, 11 | configurable: true 12 | } 13 | }) 14 | } 15 | }; 16 | } else { 17 | // old school shim for old browsers 18 | module.exports = function inherits(ctor, superCtor) { 19 | if (superCtor) { 20 | ctor.super_ = superCtor 21 | var TempCtor = function () {} 22 | TempCtor.prototype = superCtor.prototype 23 | ctor.prototype = new TempCtor() 24 | ctor.prototype.constructor = ctor 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/inherits/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "inherits", 3 | "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()", 4 | "version": "2.0.4", 5 | "keywords": [ 6 | "inheritance", 7 | "class", 8 | "klass", 9 | "oop", 10 | "object-oriented", 11 | "inherits", 12 | "browser", 13 | "browserify" 14 | ], 15 | "main": "./inherits.js", 16 | "browser": "./inherits_browser.js", 17 | "repository": "git://github.com/isaacs/inherits", 18 | "license": "ISC", 19 | "scripts": { 20 | "test": "tap" 21 | }, 22 | "devDependencies": { 23 | "tap": "^14.2.4" 24 | }, 25 | "files": [ 26 | "inherits.js", 27 | "inherits_browser.js" 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/ipaddr.js/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2011-2017 whitequark 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/ipaddr.js/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ipaddr.js", 3 | "description": "A library for manipulating IPv4 and IPv6 addresses in JavaScript.", 4 | "version": "1.9.1", 5 | "author": "whitequark ", 6 | "directories": { 7 | "lib": "./lib" 8 | }, 9 | "dependencies": {}, 10 | "devDependencies": { 11 | "coffee-script": "~1.12.6", 12 | "nodeunit": "^0.11.3", 13 | "uglify-js": "~3.0.19" 14 | }, 15 | "scripts": { 16 | "test": "cake build test" 17 | }, 18 | "files": [ 19 | "lib/", 20 | "LICENSE", 21 | "ipaddr.min.js" 22 | ], 23 | "keywords": [ 24 | "ip", 25 | "ipv4", 26 | "ipv6" 27 | ], 28 | "repository": "git://github.com/whitequark/ipaddr.js", 29 | "main": "./lib/ipaddr.js", 30 | "engines": { 31 | "node": ">= 0.10" 32 | }, 33 | "license": "MIT", 34 | "types": "./lib/ipaddr.js.d.ts" 35 | } 36 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/media-typer/HISTORY.md: -------------------------------------------------------------------------------- 1 | 0.3.0 / 2014-09-07 2 | ================== 3 | 4 | * Support Node.js 0.6 5 | * Throw error when parameter format invalid on parse 6 | 7 | 0.2.0 / 2014-06-18 8 | ================== 9 | 10 | * Add `typer.format()` to format media types 11 | 12 | 0.1.0 / 2014-06-17 13 | ================== 14 | 15 | * Accept `req` as argument to `parse` 16 | * Accept `res` as argument to `parse` 17 | * Parse media type with extra LWS between type and first parameter 18 | 19 | 0.0.0 / 2014-06-13 20 | ================== 21 | 22 | * Initial implementation 23 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/media-typer/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2014 Douglas Christopher Wilson 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | 'Software'), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/media-typer/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "media-typer", 3 | "description": "Simple RFC 6838 media type parser and formatter", 4 | "version": "0.3.0", 5 | "author": "Douglas Christopher Wilson ", 6 | "license": "MIT", 7 | "repository": "jshttp/media-typer", 8 | "devDependencies": { 9 | "istanbul": "0.3.2", 10 | "mocha": "~1.21.4", 11 | "should": "~4.0.4" 12 | }, 13 | "files": [ 14 | "LICENSE", 15 | "HISTORY.md", 16 | "index.js" 17 | ], 18 | "engines": { 19 | "node": ">= 0.6" 20 | }, 21 | "scripts": { 22 | "test": "mocha --reporter spec --check-leaks --bail test/", 23 | "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", 24 | "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/merge-descriptors/HISTORY.md: -------------------------------------------------------------------------------- 1 | 1.0.1 / 2016-01-17 2 | ================== 3 | 4 | * perf: enable strict mode 5 | 6 | 1.0.0 / 2015-03-01 7 | ================== 8 | 9 | * Add option to only add new descriptors 10 | * Add simple argument validation 11 | * Add jsdoc to source file 12 | 13 | 0.0.2 / 2013-12-14 14 | ================== 15 | 16 | * Move repository to `component` organization 17 | 18 | 0.0.1 / 2013-10-29 19 | ================== 20 | 21 | * Initial release 22 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/merge-descriptors/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "merge-descriptors", 3 | "description": "Merge objects using descriptors", 4 | "version": "1.0.1", 5 | "author": { 6 | "name": "Jonathan Ong", 7 | "email": "me@jongleberry.com", 8 | "url": "http://jongleberry.com", 9 | "twitter": "https://twitter.com/jongleberry" 10 | }, 11 | "contributors": [ 12 | "Douglas Christopher Wilson ", 13 | "Mike Grabowski " 14 | ], 15 | "license": "MIT", 16 | "repository": "component/merge-descriptors", 17 | "devDependencies": { 18 | "istanbul": "0.4.1", 19 | "mocha": "1.21.5" 20 | }, 21 | "files": [ 22 | "HISTORY.md", 23 | "LICENSE", 24 | "README.md", 25 | "index.js" 26 | ], 27 | "scripts": { 28 | "test": "mocha --reporter spec --bail --check-leaks test/", 29 | "test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/", 30 | "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/methods/HISTORY.md: -------------------------------------------------------------------------------- 1 | 1.1.2 / 2016-01-17 2 | ================== 3 | 4 | * perf: enable strict mode 5 | 6 | 1.1.1 / 2014-12-30 7 | ================== 8 | 9 | * Improve `browserify` support 10 | 11 | 1.1.0 / 2014-07-05 12 | ================== 13 | 14 | * Add `CONNECT` method 15 | 16 | 1.0.1 / 2014-06-02 17 | ================== 18 | 19 | * Fix module to work with harmony transform 20 | 21 | 1.0.0 / 2014-05-08 22 | ================== 23 | 24 | * Add `PURGE` method 25 | 26 | 0.1.0 / 2013-10-28 27 | ================== 28 | 29 | * Add `http.METHODS` support 30 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/methods/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "methods", 3 | "description": "HTTP methods that node supports", 4 | "version": "1.1.2", 5 | "contributors": [ 6 | "Douglas Christopher Wilson ", 7 | "Jonathan Ong (http://jongleberry.com)", 8 | "TJ Holowaychuk (http://tjholowaychuk.com)" 9 | ], 10 | "license": "MIT", 11 | "repository": "jshttp/methods", 12 | "devDependencies": { 13 | "istanbul": "0.4.1", 14 | "mocha": "1.21.5" 15 | }, 16 | "files": [ 17 | "index.js", 18 | "HISTORY.md", 19 | "LICENSE" 20 | ], 21 | "engines": { 22 | "node": ">= 0.6" 23 | }, 24 | "scripts": { 25 | "test": "mocha --reporter spec --bail --check-leaks test/", 26 | "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", 27 | "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" 28 | }, 29 | "browser": { 30 | "http": false 31 | }, 32 | "keywords": [ 33 | "http", 34 | "methods" 35 | ] 36 | } 37 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/mime-db/index.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * mime-db 3 | * Copyright(c) 2014 Jonathan Ong 4 | * Copyright(c) 2015-2022 Douglas Christopher Wilson 5 | * MIT Licensed 6 | */ 7 | 8 | /** 9 | * Module exports. 10 | */ 11 | 12 | module.exports = require('./db.json') 13 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/mime/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2010 Benjamin Thomas, Robert Kieffer 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/mime/cli.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | var mime = require('./mime.js'); 4 | var file = process.argv[2]; 5 | var type = mime.lookup(file); 6 | 7 | process.stdout.write(type + '\n'); 8 | 9 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/mime/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": { 3 | "name": "Robert Kieffer", 4 | "url": "http://github.com/broofa", 5 | "email": "robert@broofa.com" 6 | }, 7 | "bin": { 8 | "mime": "cli.js" 9 | }, 10 | "engines": { 11 | "node": ">=4" 12 | }, 13 | "contributors": [ 14 | { 15 | "name": "Benjamin Thomas", 16 | "url": "http://github.com/bentomas", 17 | "email": "benjamin@benjaminthomas.org" 18 | } 19 | ], 20 | "description": "A comprehensive library for mime-type mapping", 21 | "license": "MIT", 22 | "dependencies": {}, 23 | "devDependencies": { 24 | "github-release-notes": "0.13.1", 25 | "mime-db": "1.31.0", 26 | "mime-score": "1.1.0" 27 | }, 28 | "scripts": { 29 | "prepare": "node src/build.js", 30 | "changelog": "gren changelog --tags=all --generate --override", 31 | "test": "node src/test.js" 32 | }, 33 | "keywords": [ 34 | "util", 35 | "mime" 36 | ], 37 | "main": "mime.js", 38 | "name": "mime", 39 | "repository": { 40 | "url": "https://github.com/broofa/node-mime", 41 | "type": "git" 42 | }, 43 | "version": "1.6.0" 44 | } 45 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/ms/license.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Zeit, Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/ms/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ms", 3 | "version": "2.0.0", 4 | "description": "Tiny milisecond conversion utility", 5 | "repository": "zeit/ms", 6 | "main": "./index", 7 | "files": [ 8 | "index.js" 9 | ], 10 | "scripts": { 11 | "precommit": "lint-staged", 12 | "lint": "eslint lib/* bin/*", 13 | "test": "mocha tests.js" 14 | }, 15 | "eslintConfig": { 16 | "extends": "eslint:recommended", 17 | "env": { 18 | "node": true, 19 | "es6": true 20 | } 21 | }, 22 | "lint-staged": { 23 | "*.js": [ 24 | "npm run lint", 25 | "prettier --single-quote --write", 26 | "git add" 27 | ] 28 | }, 29 | "license": "MIT", 30 | "devDependencies": { 31 | "eslint": "3.19.0", 32 | "expect.js": "0.3.1", 33 | "husky": "0.13.3", 34 | "lint-staged": "3.4.1", 35 | "mocha": "3.4.1" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/object-inspect/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2013 James Halliday 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/object-inspect/example/all.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var inspect = require('../'); 4 | var Buffer = require('safer-buffer').Buffer; 5 | 6 | var holes = ['a', 'b']; 7 | holes[4] = 'e'; 8 | holes[6] = 'g'; 9 | 10 | var obj = { 11 | a: 1, 12 | b: [3, 4, undefined, null], 13 | c: undefined, 14 | d: null, 15 | e: { 16 | regex: /^x/i, 17 | buf: Buffer.from('abc'), 18 | holes: holes 19 | }, 20 | now: new Date() 21 | }; 22 | obj.self = obj; 23 | console.log(inspect(obj)); 24 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/object-inspect/example/circular.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var inspect = require('../'); 4 | var obj = { a: 1, b: [3, 4] }; 5 | obj.c = obj; 6 | console.log(inspect(obj)); 7 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/object-inspect/example/fn.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var inspect = require('../'); 4 | var obj = [1, 2, function f(n) { return n + 5; }, 4]; 5 | console.log(inspect(obj)); 6 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/object-inspect/example/inspect.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /* eslint-env browser */ 4 | var inspect = require('../'); 5 | 6 | var d = document.createElement('div'); 7 | d.setAttribute('id', 'beep'); 8 | d.innerHTML = 'woooiiiii'; 9 | 10 | console.log(inspect([d, { a: 3, b: 4, c: [5, 6, [7, [8, [9]]]] }])); 11 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/object-inspect/package-support.json: -------------------------------------------------------------------------------- 1 | { 2 | "versions": [ 3 | { 4 | "version": "*", 5 | "target": { 6 | "node": "all" 7 | }, 8 | "response": { 9 | "type": "time-permitting" 10 | }, 11 | "backing": { 12 | "npm-funding": true, 13 | "donations": [ 14 | "https://github.com/ljharb", 15 | "https://tidelift.com/funding/github/npm/object-inspect" 16 | ] 17 | } 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/object-inspect/test-core-js.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | require('core-js'); 4 | 5 | var inspect = require('./'); 6 | var test = require('tape'); 7 | 8 | test('Maps', function (t) { 9 | t.equal(inspect(new Map([[1, 2]])), 'Map (1) {1 => 2}'); 10 | t.end(); 11 | }); 12 | 13 | test('WeakMaps', function (t) { 14 | t.equal(inspect(new WeakMap([[{}, 2]])), 'WeakMap { ? }'); 15 | t.end(); 16 | }); 17 | 18 | test('Sets', function (t) { 19 | t.equal(inspect(new Set([[1, 2]])), 'Set (1) {[ 1, 2 ]}'); 20 | t.end(); 21 | }); 22 | 23 | test('WeakSets', function (t) { 24 | t.equal(inspect(new WeakSet([[1, 2]])), 'WeakSet { ? }'); 25 | t.end(); 26 | }); 27 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/object-inspect/test/browser/dom.js: -------------------------------------------------------------------------------- 1 | var inspect = require('../../'); 2 | var test = require('tape'); 3 | 4 | test('dom element', function (t) { 5 | t.plan(1); 6 | 7 | var d = document.createElement('div'); 8 | d.setAttribute('id', 'beep'); 9 | d.innerHTML = 'woooiiiii'; 10 | 11 | t.equal( 12 | inspect([d, { a: 3, b: 4, c: [5, 6, [7, [8, [9]]]] }]), 13 | '[
...
, { a: 3, b: 4, c: [ 5, 6, [ 7, [ 8, [Object] ] ] ] } ]' 14 | ); 15 | }); 16 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/object-inspect/test/circular.js: -------------------------------------------------------------------------------- 1 | var inspect = require('../'); 2 | var test = require('tape'); 3 | 4 | test('circular', function (t) { 5 | t.plan(2); 6 | var obj = { a: 1, b: [3, 4] }; 7 | obj.c = obj; 8 | t.equal(inspect(obj), '{ a: 1, b: [ 3, 4 ], c: [Circular] }'); 9 | 10 | var double = {}; 11 | double.a = [double]; 12 | double.b = {}; 13 | double.b.inner = double.b; 14 | double.b.obj = double; 15 | t.equal(inspect(double), '{ a: [ [Circular] ], b: { inner: [Circular], obj: [Circular] } }'); 16 | }); 17 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/object-inspect/test/deep.js: -------------------------------------------------------------------------------- 1 | var inspect = require('../'); 2 | var test = require('tape'); 3 | 4 | test('deep', function (t) { 5 | t.plan(4); 6 | var obj = [[[[[[500]]]]]]; 7 | t.equal(inspect(obj), '[ [ [ [ [ [Array] ] ] ] ] ]'); 8 | t.equal(inspect(obj, { depth: 4 }), '[ [ [ [ [Array] ] ] ] ]'); 9 | t.equal(inspect(obj, { depth: 2 }), '[ [ [Array] ] ]'); 10 | 11 | t.equal(inspect([[[{ a: 1 }]]], { depth: 3 }), '[ [ [ [Object] ] ] ]'); 12 | }); 13 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/object-inspect/test/fakes.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var inspect = require('../'); 4 | var test = require('tape'); 5 | var hasToStringTag = require('has-tostringtag/shams')(); 6 | var forEach = require('for-each'); 7 | 8 | test('fakes', { skip: !hasToStringTag }, function (t) { 9 | forEach([ 10 | 'Array', 11 | 'Boolean', 12 | 'Date', 13 | 'Error', 14 | 'Number', 15 | 'RegExp', 16 | 'String' 17 | ], function (expected) { 18 | var faker = {}; 19 | faker[Symbol.toStringTag] = expected; 20 | 21 | t.equal( 22 | inspect(faker), 23 | '{ [Symbol(Symbol.toStringTag)]: \'' + expected + '\' }', 24 | 'faker masquerading as ' + expected + ' is not shown as one' 25 | ); 26 | }); 27 | 28 | t.end(); 29 | }); 30 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/object-inspect/test/has.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var inspect = require('../'); 4 | var test = require('tape'); 5 | var mockProperty = require('mock-property'); 6 | 7 | test('when Object#hasOwnProperty is deleted', function (t) { 8 | t.plan(1); 9 | var arr = [1, , 3]; // eslint-disable-line no-sparse-arrays 10 | 11 | t.teardown(mockProperty(Array.prototype, 1, { value: 2 })); // this is needed to account for "in" vs "hasOwnProperty" 12 | t.teardown(mockProperty(Object.prototype, 'hasOwnProperty', { 'delete': true })); 13 | 14 | t.equal(inspect(arr), '[ 1, , 3 ]'); 15 | }); 16 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/object-inspect/test/holes.js: -------------------------------------------------------------------------------- 1 | var test = require('tape'); 2 | var inspect = require('../'); 3 | 4 | var xs = ['a', 'b']; 5 | xs[5] = 'f'; 6 | xs[7] = 'j'; 7 | xs[8] = 'k'; 8 | 9 | test('holes', function (t) { 10 | t.plan(1); 11 | t.equal( 12 | inspect(xs), 13 | "[ 'a', 'b', , , , 'f', , 'j', 'k' ]" 14 | ); 15 | }); 16 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/object-inspect/test/lowbyte.js: -------------------------------------------------------------------------------- 1 | var test = require('tape'); 2 | var inspect = require('../'); 3 | 4 | var obj = { x: 'a\r\nb', y: '\x05! \x1f \x12' }; 5 | 6 | test('interpolate low bytes', function (t) { 7 | t.plan(1); 8 | t.equal( 9 | inspect(obj), 10 | "{ x: 'a\\r\\nb', y: '\\x05! \\x1F \\x12' }" 11 | ); 12 | }); 13 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/object-inspect/test/quoteStyle.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var inspect = require('../'); 4 | var test = require('tape'); 5 | 6 | test('quoteStyle option', function (t) { 7 | t['throws'](function () { inspect(null, { quoteStyle: false }); }, 'false is not a valid value'); 8 | t['throws'](function () { inspect(null, { quoteStyle: true }); }, 'true is not a valid value'); 9 | t['throws'](function () { inspect(null, { quoteStyle: '' }); }, '"" is not a valid value'); 10 | t['throws'](function () { inspect(null, { quoteStyle: {} }); }, '{} is not a valid value'); 11 | t['throws'](function () { inspect(null, { quoteStyle: [] }); }, '[] is not a valid value'); 12 | t['throws'](function () { inspect(null, { quoteStyle: 42 }); }, '42 is not a valid value'); 13 | t['throws'](function () { inspect(null, { quoteStyle: NaN }); }, 'NaN is not a valid value'); 14 | t['throws'](function () { inspect(null, { quoteStyle: function () {} }); }, 'a function is not a valid value'); 15 | 16 | t.end(); 17 | }); 18 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/object-inspect/test/undef.js: -------------------------------------------------------------------------------- 1 | var test = require('tape'); 2 | var inspect = require('../'); 3 | 4 | var obj = { a: 1, b: [3, 4, undefined, null], c: undefined, d: null }; 5 | 6 | test('undef and null', function (t) { 7 | t.plan(1); 8 | t.equal( 9 | inspect(obj), 10 | '{ a: 1, b: [ 3, 4, undefined, null ], c: undefined, d: null }' 11 | ); 12 | }); 13 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/object-inspect/util.inspect.js: -------------------------------------------------------------------------------- 1 | module.exports = require('util').inspect; 2 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/path-to-regexp/History.md: -------------------------------------------------------------------------------- 1 | 0.1.7 / 2015-07-28 2 | ================== 3 | 4 | * Fixed regression with escaped round brackets and matching groups. 5 | 6 | 0.1.6 / 2015-06-19 7 | ================== 8 | 9 | * Replace `index` feature by outputting all parameters, unnamed and named. 10 | 11 | 0.1.5 / 2015-05-08 12 | ================== 13 | 14 | * Add an index property for position in match result. 15 | 16 | 0.1.4 / 2015-03-05 17 | ================== 18 | 19 | * Add license information 20 | 21 | 0.1.3 / 2014-07-06 22 | ================== 23 | 24 | * Better array support 25 | * Improved support for trailing slash in non-ending mode 26 | 27 | 0.1.0 / 2014-03-06 28 | ================== 29 | 30 | * add options.end 31 | 32 | 0.0.2 / 2013-02-10 33 | ================== 34 | 35 | * Update to match current express 36 | * add .license property to component.json 37 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/path-to-regexp/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "path-to-regexp", 3 | "description": "Express style path to RegExp utility", 4 | "version": "0.1.7", 5 | "files": [ 6 | "index.js", 7 | "LICENSE" 8 | ], 9 | "scripts": { 10 | "test": "istanbul cover _mocha -- -R spec" 11 | }, 12 | "keywords": [ 13 | "express", 14 | "regexp" 15 | ], 16 | "component": { 17 | "scripts": { 18 | "path-to-regexp": "index.js" 19 | } 20 | }, 21 | "license": "MIT", 22 | "repository": { 23 | "type": "git", 24 | "url": "https://github.com/component/path-to-regexp.git" 25 | }, 26 | "devDependencies": { 27 | "mocha": "^1.17.1", 28 | "istanbul": "^0.2.6" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/proxy-addr/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2014-2016 Douglas Christopher Wilson 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | 'Software'), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/qs/lib/formats.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var replace = String.prototype.replace; 4 | var percentTwenties = /%20/g; 5 | 6 | var Format = { 7 | RFC1738: 'RFC1738', 8 | RFC3986: 'RFC3986' 9 | }; 10 | 11 | module.exports = { 12 | 'default': Format.RFC3986, 13 | formatters: { 14 | RFC1738: function (value) { 15 | return replace.call(value, percentTwenties, '+'); 16 | }, 17 | RFC3986: function (value) { 18 | return String(value); 19 | } 20 | }, 21 | RFC1738: Format.RFC1738, 22 | RFC3986: Format.RFC3986 23 | }; 24 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/qs/lib/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var stringify = require('./stringify'); 4 | var parse = require('./parse'); 5 | var formats = require('./formats'); 6 | 7 | module.exports = { 8 | formats: formats, 9 | parse: parse, 10 | stringify: stringify 11 | }; 12 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/safe-buffer/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Feross Aboukhadijeh 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/safer-buffer/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "safer-buffer", 3 | "version": "2.1.2", 4 | "description": "Modern Buffer API polyfill without footguns", 5 | "main": "safer.js", 6 | "scripts": { 7 | "browserify-test": "browserify --external tape tests.js > browserify-tests.js && tape browserify-tests.js", 8 | "test": "standard && tape tests.js" 9 | }, 10 | "author": { 11 | "name": "Nikita Skovoroda", 12 | "email": "chalkerx@gmail.com", 13 | "url": "https://github.com/ChALkeR" 14 | }, 15 | "license": "MIT", 16 | "repository": { 17 | "type": "git", 18 | "url": "git+https://github.com/ChALkeR/safer-buffer.git" 19 | }, 20 | "bugs": { 21 | "url": "https://github.com/ChALkeR/safer-buffer/issues" 22 | }, 23 | "devDependencies": { 24 | "standard": "^11.0.1", 25 | "tape": "^4.9.0" 26 | }, 27 | "files": [ 28 | "Porting-Buffer.md", 29 | "Readme.md", 30 | "tests.js", 31 | "dangerous.js", 32 | "safer.js" 33 | ] 34 | } 35 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/send/node_modules/ms/license.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2020 Vercel, Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/send/node_modules/ms/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ms", 3 | "version": "2.1.3", 4 | "description": "Tiny millisecond conversion utility", 5 | "repository": "vercel/ms", 6 | "main": "./index", 7 | "files": [ 8 | "index.js" 9 | ], 10 | "scripts": { 11 | "precommit": "lint-staged", 12 | "lint": "eslint lib/* bin/*", 13 | "test": "mocha tests.js" 14 | }, 15 | "eslintConfig": { 16 | "extends": "eslint:recommended", 17 | "env": { 18 | "node": true, 19 | "es6": true 20 | } 21 | }, 22 | "lint-staged": { 23 | "*.js": [ 24 | "npm run lint", 25 | "prettier --single-quote --write", 26 | "git add" 27 | ] 28 | }, 29 | "license": "MIT", 30 | "devDependencies": { 31 | "eslint": "4.18.2", 32 | "expect.js": "0.3.1", 33 | "husky": "0.14.3", 34 | "lint-staged": "5.0.0", 35 | "mocha": "4.0.1", 36 | "prettier": "2.0.5" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/setprototypeof/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015, Wes Todd 2 | 3 | Permission to use, copy, modify, and/or distribute this software for any 4 | purpose with or without fee is hereby granted, provided that the above 5 | copyright notice and this permission notice appear in all copies. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 8 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 9 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 10 | SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 11 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 12 | OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 13 | CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 14 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/setprototypeof/README.md: -------------------------------------------------------------------------------- 1 | # Polyfill for `Object.setPrototypeOf` 2 | 3 | [![NPM Version](https://img.shields.io/npm/v/setprototypeof.svg)](https://npmjs.org/package/setprototypeof) 4 | [![NPM Downloads](https://img.shields.io/npm/dm/setprototypeof.svg)](https://npmjs.org/package/setprototypeof) 5 | [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://github.com/standard/standard) 6 | 7 | A simple cross platform implementation to set the prototype of an instianted object. Supports all modern browsers and at least back to IE8. 8 | 9 | ## Usage: 10 | 11 | ``` 12 | $ npm install --save setprototypeof 13 | ``` 14 | 15 | ```javascript 16 | var setPrototypeOf = require('setprototypeof') 17 | 18 | var obj = {} 19 | setPrototypeOf(obj, { 20 | foo: function () { 21 | return 'bar' 22 | } 23 | }) 24 | obj.foo() // bar 25 | ``` 26 | 27 | TypeScript is also supported: 28 | 29 | ```typescript 30 | import setPrototypeOf from 'setprototypeof' 31 | ``` 32 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/setprototypeof/index.d.ts: -------------------------------------------------------------------------------- 1 | declare function setPrototypeOf(o: any, proto: object | null): any; 2 | export = setPrototypeOf; 3 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/setprototypeof/index.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | /* eslint no-proto: 0 */ 3 | module.exports = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array ? setProtoOf : mixinProperties) 4 | 5 | function setProtoOf (obj, proto) { 6 | obj.__proto__ = proto 7 | return obj 8 | } 9 | 10 | function mixinProperties (obj, proto) { 11 | for (var prop in proto) { 12 | if (!Object.prototype.hasOwnProperty.call(obj, prop)) { 13 | obj[prop] = proto[prop] 14 | } 15 | } 16 | return obj 17 | } 18 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/setprototypeof/test/index.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | /* eslint-env mocha */ 3 | /* eslint no-proto: 0 */ 4 | var assert = require('assert') 5 | var setPrototypeOf = require('..') 6 | 7 | describe('setProtoOf(obj, proto)', function () { 8 | it('should merge objects', function () { 9 | var obj = { a: 1, b: 2 } 10 | var proto = { b: 3, c: 4 } 11 | var mergeObj = setPrototypeOf(obj, proto) 12 | 13 | if (Object.getPrototypeOf) { 14 | assert.strictEqual(Object.getPrototypeOf(obj), proto) 15 | } else if ({ __proto__: [] } instanceof Array) { 16 | assert.strictEqual(obj.__proto__, proto) 17 | } else { 18 | assert.strictEqual(obj.a, 1) 19 | assert.strictEqual(obj.b, 2) 20 | assert.strictEqual(obj.c, 4) 21 | } 22 | assert.strictEqual(mergeObj, obj) 23 | }) 24 | }) 25 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/side-channel/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Jordan Harband 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/side-channel/README.md: -------------------------------------------------------------------------------- 1 | # side-channel 2 | Store information about any JS value in a side channel. Uses WeakMap if available. 3 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/toidentifier/HISTORY.md: -------------------------------------------------------------------------------- 1 | 1.0.1 / 2021-11-14 2 | ================== 3 | 4 | * pref: enable strict mode 5 | 6 | 1.0.0 / 2018-07-09 7 | ================== 8 | 9 | * Initial release 10 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/toidentifier/index.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * toidentifier 3 | * Copyright(c) 2016 Douglas Christopher Wilson 4 | * MIT Licensed 5 | */ 6 | 7 | 'use strict' 8 | 9 | /** 10 | * Module exports. 11 | * @public 12 | */ 13 | 14 | module.exports = toIdentifier 15 | 16 | /** 17 | * Trasform the given string into a JavaScript identifier 18 | * 19 | * @param {string} str 20 | * @returns {string} 21 | * @public 22 | */ 23 | 24 | function toIdentifier (str) { 25 | return str 26 | .split(' ') 27 | .map(function (token) { 28 | return token.slice(0, 1).toUpperCase() + token.slice(1) 29 | }) 30 | .join('') 31 | .replace(/[^ _0-9a-z]/gi, '') 32 | } 33 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/unpipe/HISTORY.md: -------------------------------------------------------------------------------- 1 | 1.0.0 / 2015-06-14 2 | ================== 3 | 4 | * Initial release 5 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/unpipe/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "unpipe", 3 | "description": "Unpipe a stream from all destinations", 4 | "version": "1.0.0", 5 | "author": "Douglas Christopher Wilson ", 6 | "license": "MIT", 7 | "repository": "stream-utils/unpipe", 8 | "devDependencies": { 9 | "istanbul": "0.3.15", 10 | "mocha": "2.2.5", 11 | "readable-stream": "1.1.13" 12 | }, 13 | "files": [ 14 | "HISTORY.md", 15 | "LICENSE", 16 | "README.md", 17 | "index.js" 18 | ], 19 | "engines": { 20 | "node": ">= 0.8" 21 | }, 22 | "scripts": { 23 | "test": "mocha --reporter spec --bail --check-leaks test/", 24 | "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", 25 | "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/utils-merge/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013-2017 Jared Hanson 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/utils-merge/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Merge object b with object a. 3 | * 4 | * var a = { foo: 'bar' } 5 | * , b = { bar: 'baz' }; 6 | * 7 | * merge(a, b); 8 | * // => { foo: 'bar', bar: 'baz' } 9 | * 10 | * @param {Object} a 11 | * @param {Object} b 12 | * @return {Object} 13 | * @api public 14 | */ 15 | 16 | exports = module.exports = function(a, b){ 17 | if (a && b) { 18 | for (var key in b) { 19 | a[key] = b[key]; 20 | } 21 | } 22 | return a; 23 | }; 24 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/utils-merge/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "utils-merge", 3 | "version": "1.0.1", 4 | "description": "merge() utility function", 5 | "keywords": [ 6 | "util" 7 | ], 8 | "author": { 9 | "name": "Jared Hanson", 10 | "email": "jaredhanson@gmail.com", 11 | "url": "http://www.jaredhanson.net/" 12 | }, 13 | "repository": { 14 | "type": "git", 15 | "url": "git://github.com/jaredhanson/utils-merge.git" 16 | }, 17 | "bugs": { 18 | "url": "http://github.com/jaredhanson/utils-merge/issues" 19 | }, 20 | "license": "MIT", 21 | "licenses": [ 22 | { 23 | "type": "MIT", 24 | "url": "http://opensource.org/licenses/MIT" 25 | } 26 | ], 27 | "main": "./index", 28 | "dependencies": {}, 29 | "devDependencies": { 30 | "make-node": "0.3.x", 31 | "mocha": "1.x.x", 32 | "chai": "1.x.x" 33 | }, 34 | "engines": { 35 | "node": ">= 0.4.0" 36 | }, 37 | "scripts": { 38 | "test": "node_modules/.bin/mocha --reporter spec --require test/bootstrap/node test/*.test.js" 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/vary/HISTORY.md: -------------------------------------------------------------------------------- 1 | 1.1.2 / 2017-09-23 2 | ================== 3 | 4 | * perf: improve header token parsing speed 5 | 6 | 1.1.1 / 2017-03-20 7 | ================== 8 | 9 | * perf: hoist regular expression 10 | 11 | 1.1.0 / 2015-09-29 12 | ================== 13 | 14 | * Only accept valid field names in the `field` argument 15 | - Ensures the resulting string is a valid HTTP header value 16 | 17 | 1.0.1 / 2015-07-08 18 | ================== 19 | 20 | * Fix setting empty header from empty `field` 21 | * perf: enable strict mode 22 | * perf: remove argument reassignments 23 | 24 | 1.0.0 / 2014-08-10 25 | ================== 26 | 27 | * Accept valid `Vary` header string as `field` 28 | * Add `vary.append` for low-level string manipulation 29 | * Move to `jshttp` orgainzation 30 | 31 | 0.1.0 / 2014-06-05 32 | ================== 33 | 34 | * Support array of fields to set 35 | 36 | 0.0.0 / 2014-06-04 37 | ================== 38 | 39 | * Initial release 40 | -------------------------------------------------------------------------------- /ch09/nodejs/node_modules/vary/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2014-2017 Douglas Christopher Wilson 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | 'Software'), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /ch09/nodejs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nodejs2", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "express": "^4.18.2" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /ch09/nodejs/public/images/fastcampus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch09/nodejs/public/images/fastcampus.png -------------------------------------------------------------------------------- /ch09/nodejs/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | My Node.js App 6 | 7 | 8 | 9 | fastcampus logo 10 |

Welcome to Fastcampus - Nodejs App using dockerfile

11 |

This is a sample Nodejs application!

12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /ch09/nodejs/public/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: Arial, sans-serif; 3 | background-color: #f5f5f5; 4 | margin: 0; 5 | padding: 20px; 6 | } 7 | 8 | h1 { 9 | color: #333; 10 | } 11 | 12 | p { 13 | color: #777; 14 | } 15 | 16 | -------------------------------------------------------------------------------- /ch09/nodejs/server.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const app = express(); 3 | const path = require('path'); 4 | 5 | // Serve static files from the "public" directory 6 | app.use(express.static('public')); 7 | 8 | // Serve the "images" directory as a static folder 9 | app.use('/images', express.static('public/images')); 10 | 11 | 12 | // Route for the homepage 13 | app.get('/', (req, res) => { 14 | res.sendFile(path.join(__dirname, 'public/index.html')); 15 | }); 16 | 17 | // Start the server 18 | const port = 3000; 19 | app.listen(port, () => { 20 | console.log(`Server running on http://localhost:${port}`); 21 | }); 22 | 23 | -------------------------------------------------------------------------------- /ch09/notepad09.txt: -------------------------------------------------------------------------------- 1 | # ch09 2 | 3 | # Dive 4 | docker run --rm -it \ 5 | -v /var/run/docker.sock:/var/run/docker.sock \ 6 | -v "$(pwd)":"$(pwd)" \ 7 | -w "$(pwd)" \ 8 | -v "$HOME/.dive.yaml":"$HOME/.dive.yaml" \ 9 | wagoodman/dive:latest build -t dive-webapp:1.0 -f dockerfile-myweb1 . 10 | 11 | docker run --rm -it \ 12 | -v /var/run/docker.sock:/var/run/docker.sock \ 13 | -v "$(pwd)":"$(pwd)" \ 14 | -w "$(pwd)" \ 15 | -v "$HOME/.dive.yaml":"$HOME/.dive.yaml" \ 16 | wagoodman/dive:latest build -t dive-webapp:1.0 -f dockerfile-myweb2 . 17 | -------------------------------------------------------------------------------- /ch09/py_flask/.dockerignore: -------------------------------------------------------------------------------- 1 | dockerfile-py 2 | -------------------------------------------------------------------------------- /ch09/py_flask/app/py_app.py: -------------------------------------------------------------------------------- 1 | from flask import Flask 2 | py_app = Flask(__name__) 3 | @py_app.route('/') 4 | def python_flask(): 5 | return """ 6 |

7 | Docker container application: Fastcampus

8 |

9 | This is micro web framework for running Flask inside Docker.

10 | """ 11 | if __name__ == '__main__': 12 | py_app.run(host='0.0.0.0', port=9000, debug=True) 13 | -------------------------------------------------------------------------------- /ch09/py_flask/app/requirements.txt: -------------------------------------------------------------------------------- 1 | Flask 2 | -------------------------------------------------------------------------------- /ch09/py_flask/dockerfile-py: -------------------------------------------------------------------------------- 1 | FROM python:3.8-alpine 2 | RUN apk update && \ 3 | apk add --no-cache \ 4 | bash 5 | RUN apk add --update build-base python3-dev py-pip 6 | ENV LIBRARY_PATH=/lib:/usr/lib 7 | ENV FLASK_APP=py_app 8 | ENV FLASK_ENV=development 9 | EXPOSE 9000 10 | WORKDIR /py_app 11 | COPY . /py_app 12 | RUN pip install -r ./app/requirements.txt 13 | ENTRYPOINT ["python"] 14 | CMD ["./app/py_app.py"] 15 | -------------------------------------------------------------------------------- /ch09/sample/Dockerfile: -------------------------------------------------------------------------------- 1 | # Step:1 ubuntu (base image) 2 | FROM ubuntu:20.04 3 | 4 | # Step:2 Nginx package install 5 | RUN apt-get -y update && apt-get install -y -q nginx 6 | 7 | # Step:3 source file copy 8 | COPY index.html /var/www/html/ 9 | 10 | # Step:4 expose Port 11 | EXPOSE 80 12 | 13 | # Step:5 Nginx start (container execution) 14 | CMD ["nginx", "-g", "daemon off;"] 15 | -------------------------------------------------------------------------------- /ch09/sample/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Docker Container Running Sample App. 4 | 5 | 6 | 7 | 8 |
9 |

Docker Container Web Application.

10 |

Great Works!

11 |

Application is now good running on a Docker Container.

12 |
13 | 14 | 15 | -------------------------------------------------------------------------------- /ch10/flask-redis/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.8-alpine 2 | RUN apk update && \ 3 | apk add --no-cache \ 4 | bash 5 | RUN apk add --update build-base python3-dev py-pip 6 | ENV LIBRARY_PATH=/lib:/usr/lib 7 | ENV FLASK_APP=py_app 8 | ENV FLASK_ENV=development 9 | EXPOSE 9000 10 | WORKDIR /py_app 11 | COPY ./app/ . 12 | RUN pip install -r requirements.txt 13 | ENTRYPOINT ["python"] 14 | CMD ["py_app.py"] 15 | -------------------------------------------------------------------------------- /ch10/flask-redis/app/py_app.py: -------------------------------------------------------------------------------- 1 | import time 2 | import redis 3 | from flask import Flask 4 | 5 | py_app = Flask(__name__) 6 | db_cache = redis.Redis(host='redis', port=6379) 7 | 8 | def web_hit_cnt(): 9 | return db_cache.incr('hits') 10 | 11 | @py_app.route('/') 12 | def python_flask(): 13 | cnt = web_hit_cnt() 14 | 15 | return '''

docker-compose application: FlasK & Redis

16 |

Good container service.

17 |

Web access count : {} times

'''.format(cnt) 18 | 19 | if __name__ == '__main__': 20 | py_app.run(host='0.0.0.0', port=9000, debug=True) 21 | 22 | -------------------------------------------------------------------------------- /ch10/flask-redis/app/requirements.txt: -------------------------------------------------------------------------------- 1 | Flask 2 | redis 3 | -------------------------------------------------------------------------------- /ch10/flask-redis/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | services: 3 | redis: 4 | image: redis:6-alpine 5 | ports: 6 | - 6379:6379 7 | restart: always 8 | flask: 9 | build: . 10 | ports: 11 | - 9000:9000 12 | depends_on: 13 | - redis 14 | restart: always 15 | -------------------------------------------------------------------------------- /ch10/flask-redis/scale-test/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | version: '3.8' 2 | services: 3 | server_web: 4 | image: httpd:2 5 | server_db: 6 | image: redis:6-alpine 7 | -------------------------------------------------------------------------------- /ch10/my-diary-3-proxy/my-diary-back/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM openjdk:11-jdk AS builder 2 | COPY ./rollingpaper/gradlew . 3 | COPY ./rollingpaper/gradle gradle 4 | COPY ./rollingpaper/build.gradle . 5 | COPY ./rollingpaper/settings.gradle . 6 | COPY ./rollingpaper/src src 7 | 8 | RUN chmod +x ./gradlew 9 | RUN ./gradlew bootJar 10 | 11 | FROM openjdk:11-jdk 12 | COPY --from=builder build/libs/*.jar app.jar 13 | 14 | EXPOSE 8080 15 | ENTRYPOINT ["java", "-jar", "/app.jar"] -------------------------------------------------------------------------------- /ch10/my-diary-3-proxy/my-diary-back/rollingpaper/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch10/my-diary-3-proxy/my-diary-back/rollingpaper/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /ch10/my-diary-3-proxy/my-diary-back/rollingpaper/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /ch10/my-diary-3-proxy/my-diary-back/rollingpaper/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'rollingpaper' 2 | -------------------------------------------------------------------------------- /ch10/my-diary-3-proxy/my-diary-back/rollingpaper/src/main/java/com/threetier/team1/rollingpaper/DTO/ApiResponseDTO.java: -------------------------------------------------------------------------------- 1 | package com.threetier.team1.rollingpaper.DTO; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Getter; 5 | 6 | @Getter 7 | @AllArgsConstructor 8 | public class ApiResponseDTO { 9 | private String message; 10 | } 11 | -------------------------------------------------------------------------------- /ch10/my-diary-3-proxy/my-diary-back/rollingpaper/src/main/java/com/threetier/team1/rollingpaper/RollingpaperApplication.java: -------------------------------------------------------------------------------- 1 | package com.threetier.team1.rollingpaper; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class RollingpaperApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(RollingpaperApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ch10/my-diary-3-proxy/my-diary-back/rollingpaper/src/main/java/com/threetier/team1/rollingpaper/domain/Paper.java: -------------------------------------------------------------------------------- 1 | package com.threetier.team1.rollingpaper.domain; 2 | 3 | import com.threetier.team1.rollingpaper.DTO.PaperDTO; 4 | import com.threetier.team1.rollingpaper.DTO.PaperDTO.CreatePaperInfo; 5 | import lombok.*; 6 | 7 | import javax.persistence.*; 8 | 9 | @Table(name = "paper") 10 | @Getter 11 | @Entity 12 | @NoArgsConstructor 13 | @AllArgsConstructor 14 | @Builder 15 | public class Paper { 16 | @Id 17 | @GeneratedValue(strategy = GenerationType.IDENTITY) 18 | private Long id; 19 | @Column(nullable = false) 20 | private String nickname; 21 | @Column(nullable = false) 22 | private String password; 23 | @Column(nullable = false) 24 | private String content; 25 | 26 | 27 | public static Paper fromDTO(CreatePaperInfo createPaperInfo) { 28 | return Paper.builder() 29 | .password(createPaperInfo.getPassword()) 30 | .nickname(createPaperInfo.getNickname()) 31 | .content(createPaperInfo.getContent()) 32 | .build(); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /ch10/my-diary-3-proxy/my-diary-back/rollingpaper/src/main/java/com/threetier/team1/rollingpaper/repository/PaperRepository.java: -------------------------------------------------------------------------------- 1 | package com.threetier.team1.rollingpaper.repository; 2 | 3 | import com.threetier.team1.rollingpaper.domain.Paper; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | import org.springframework.stereotype.Repository; 6 | 7 | @Repository 8 | public interface PaperRepository extends JpaRepository { 9 | } 10 | -------------------------------------------------------------------------------- /ch10/my-diary-3-proxy/my-diary-back/rollingpaper/src/main/java/com/threetier/team1/rollingpaper/service/PaperService.java: -------------------------------------------------------------------------------- 1 | package com.threetier.team1.rollingpaper.service; 2 | 3 | import com.threetier.team1.rollingpaper.DTO.PaperDTO; 4 | import com.threetier.team1.rollingpaper.DTO.PaperDTO.CreatePaperInfo; 5 | import com.threetier.team1.rollingpaper.DTO.PaperDTO.DeletePaperInfo; 6 | import com.threetier.team1.rollingpaper.DTO.PaperDTO.ShowListInfo; 7 | import com.threetier.team1.rollingpaper.domain.Paper; 8 | 9 | import java.util.List; 10 | 11 | public interface PaperService { 12 | List getList(); 13 | 14 | void write(CreatePaperInfo createPaperInfo); 15 | 16 | int delete(DeletePaperInfo deletePaperInfo); 17 | } 18 | -------------------------------------------------------------------------------- /ch10/my-diary-3-proxy/my-diary-back/rollingpaper/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | driver-class-name: com.mysql.cj.jdbc.Driver 4 | url: jdbc:mysql://rolling-db:3306/paperdb?serverTimezone=Asia/Seoul 5 | username: user 6 | password: user 7 | jpa: 8 | hibernate: 9 | ddl-auto: update 10 | properties: 11 | hibernate: 12 | show_sql: true 13 | format_sql: true 14 | database: mysql 15 | database-platform: org.hibernate.dialect.MySQL57InnoDBDialect 16 | level: 17 | org: 18 | hibernate: 19 | type: trace -------------------------------------------------------------------------------- /ch10/my-diary-3-proxy/my-diary-back/rollingpaper/src/test/java/com/threetier/team1/rollingpaper/RollingpaperApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.threetier.team1.rollingpaper; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class RollingpaperApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ch10/my-diary-3-proxy/my-diary-front/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:17-slim 2 | WORKDIR /home/node 3 | COPY ./ ./ 4 | RUN npm -y install 5 | EXPOSE 3000 6 | CMD ["npm","run","start"] 7 | -------------------------------------------------------------------------------- /ch10/my-diary-3-proxy/my-diary-front/Jenkinsfile.txt: -------------------------------------------------------------------------------- 1 | pipeline { 2 | agent any 3 | 4 | stages { 5 | stage('Build') { 6 | steps { 7 | sh 'docker build -t rolling .' 8 | } 9 | } 10 | stage('Tag') { 11 | steps { 12 | sh 'docker tag rolling:latest 594682333406.dkr.ecr.ap-northeast-2.amazonaws.com/rolling:1.0' 13 | } 14 | } 15 | stage('Push') { 16 | environment { 17 | AWS_ACCESS_KEY_ID = credentials('awsaccess') 18 | AWS_SECRET_ACCESS_KEY = credentials('awssecret') 19 | } 20 | steps { 21 | sh 'aws ecr get-login-password --region ap-northeast-2 | docker login --username AWS --password-stdin 594682333406.dkr.ecr.ap-northeast-2.amazonaws.com' 22 | sh 'docker push 594682333406.dkr.ecr.ap-northeast-2.amazonaws.com/rolling:1.0' 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /ch10/my-diary-3-proxy/my-diary-front/fastcampus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch10/my-diary-3-proxy/my-diary-front/fastcampus.png -------------------------------------------------------------------------------- /ch10/my-diary-3-proxy/my-diary-front/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "test", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "app.js", 6 | "scripts": { 7 | "start": "node app.js", 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "bugs": { 13 | "url": "https://github.com/ksee1230/react-board-new/issues" 14 | }, 15 | "homepage": "https://github.com/ksee1230/react-board-new#readme", 16 | "dependencies": { 17 | "axios": "^0.27.2", 18 | "ejs": "^3.1.8", 19 | "express": "^4.18.1", 20 | "express-es6-template-engine": "^2.2.3" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /ch10/my-diary-3-proxy/my-diary-front/public/fastcampus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch10/my-diary-3-proxy/my-diary-front/public/fastcampus.png -------------------------------------------------------------------------------- /ch10/my-diary-3-proxy/proxy/nginx-be.conf: -------------------------------------------------------------------------------- 1 | events { worker_connections 1024; } 2 | http{ 3 | upstream mydiary-back { # upstream의 이름을 rolling-server로 설정 4 | server mydiary-back:8081; 5 | server mydiary-back:8082; 6 | server mydiary-back:8083; 7 | } 8 | server { 9 | listen *:8080 default_server; # 클라이언트가 요청하는 포트 번호 10 | location / { 11 | proxy_pass http://mydiary-back; # 설정한 upstream으로 요청 보내기 12 | } 13 | } 14 | } 15 | 16 | -------------------------------------------------------------------------------- /ch10/my-diary-3-proxy/proxy/nginx-fe.conf: -------------------------------------------------------------------------------- 1 | events { worker_connections 1024; } 2 | http { 3 | upstream front-servers { 4 | server mydiary-front:3000; 5 | server mydiary-front:3001; 6 | server mydiary-front:3002; 7 | } 8 | server { 9 | listen 80 default_server; 10 | location / { 11 | proxy_pass http://front-servers; 12 | } 13 | } 14 | } 15 | 16 | -------------------------------------------------------------------------------- /ch10/my-diary-3/my-diary-back/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM openjdk:11-jdk AS builder 2 | COPY ./rollingpaper/gradlew . 3 | COPY ./rollingpaper/gradle gradle 4 | COPY ./rollingpaper/build.gradle . 5 | COPY ./rollingpaper/settings.gradle . 6 | COPY ./rollingpaper/src src 7 | 8 | RUN chmod +x ./gradlew 9 | RUN ./gradlew bootJar 10 | 11 | FROM openjdk:11-jdk 12 | COPY --from=builder build/libs/*.jar app.jar 13 | 14 | EXPOSE 8080 15 | ENTRYPOINT ["java", "-jar", "/app.jar"] -------------------------------------------------------------------------------- /ch10/my-diary-3/my-diary-back/rollingpaper/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'org.springframework.boot' version '2.7.3' 3 | id 'io.spring.dependency-management' version '1.0.13.RELEASE' 4 | id 'java' 5 | } 6 | 7 | group = 'com.threetier.team1' 8 | version = '0.0.1-SNAPSHOT' 9 | sourceCompatibility = '11' 10 | 11 | configurations { 12 | compileOnly { 13 | extendsFrom annotationProcessor 14 | } 15 | } 16 | 17 | repositories { 18 | mavenCentral() 19 | } 20 | 21 | compileJava.options.encoding = 'UTF-8' 22 | tasks.withType(JavaCompile) { 23 | options.encoding = 'UTF-8' 24 | } 25 | 26 | dependencies { 27 | implementation 'org.springframework.boot:spring-boot-starter-data-jpa' 28 | implementation 'org.springframework.boot:spring-boot-starter-web' 29 | implementation 'org.springframework.boot:spring-boot-starter-validation' 30 | 31 | compileOnly 'org.projectlombok:lombok' 32 | runtimeOnly 'mysql:mysql-connector-java' 33 | annotationProcessor 'org.projectlombok:lombok' 34 | annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor' 35 | testImplementation 'org.springframework.boot:spring-boot-starter-test' 36 | } 37 | 38 | tasks.named('test') { 39 | useJUnitPlatform() 40 | } 41 | -------------------------------------------------------------------------------- /ch10/my-diary-3/my-diary-back/rollingpaper/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch10/my-diary-3/my-diary-back/rollingpaper/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /ch10/my-diary-3/my-diary-back/rollingpaper/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /ch10/my-diary-3/my-diary-back/rollingpaper/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'rollingpaper' 2 | -------------------------------------------------------------------------------- /ch10/my-diary-3/my-diary-back/rollingpaper/src/main/java/com/threetier/team1/rollingpaper/DTO/ApiResponseDTO.java: -------------------------------------------------------------------------------- 1 | package com.threetier.team1.rollingpaper.DTO; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Getter; 5 | 6 | @Getter 7 | @AllArgsConstructor 8 | public class ApiResponseDTO { 9 | private String message; 10 | } 11 | -------------------------------------------------------------------------------- /ch10/my-diary-3/my-diary-back/rollingpaper/src/main/java/com/threetier/team1/rollingpaper/RollingpaperApplication.java: -------------------------------------------------------------------------------- 1 | package com.threetier.team1.rollingpaper; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class RollingpaperApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(RollingpaperApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ch10/my-diary-3/my-diary-back/rollingpaper/src/main/java/com/threetier/team1/rollingpaper/domain/Paper.java: -------------------------------------------------------------------------------- 1 | package com.threetier.team1.rollingpaper.domain; 2 | 3 | import com.threetier.team1.rollingpaper.DTO.PaperDTO; 4 | import com.threetier.team1.rollingpaper.DTO.PaperDTO.CreatePaperInfo; 5 | import lombok.*; 6 | 7 | import javax.persistence.*; 8 | 9 | @Table(name = "paper") 10 | @Getter 11 | @Entity 12 | @NoArgsConstructor 13 | @AllArgsConstructor 14 | @Builder 15 | public class Paper { 16 | @Id 17 | @GeneratedValue(strategy = GenerationType.IDENTITY) 18 | private Long id; 19 | @Column(nullable = false) 20 | private String nickname; 21 | @Column(nullable = false) 22 | private String password; 23 | @Column(nullable = false) 24 | private String content; 25 | 26 | 27 | public static Paper fromDTO(CreatePaperInfo createPaperInfo) { 28 | return Paper.builder() 29 | .password(createPaperInfo.getPassword()) 30 | .nickname(createPaperInfo.getNickname()) 31 | .content(createPaperInfo.getContent()) 32 | .build(); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /ch10/my-diary-3/my-diary-back/rollingpaper/src/main/java/com/threetier/team1/rollingpaper/repository/PaperRepository.java: -------------------------------------------------------------------------------- 1 | package com.threetier.team1.rollingpaper.repository; 2 | 3 | import com.threetier.team1.rollingpaper.domain.Paper; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | import org.springframework.stereotype.Repository; 6 | 7 | @Repository 8 | public interface PaperRepository extends JpaRepository { 9 | } 10 | -------------------------------------------------------------------------------- /ch10/my-diary-3/my-diary-back/rollingpaper/src/main/java/com/threetier/team1/rollingpaper/service/PaperService.java: -------------------------------------------------------------------------------- 1 | package com.threetier.team1.rollingpaper.service; 2 | 3 | import com.threetier.team1.rollingpaper.DTO.PaperDTO; 4 | import com.threetier.team1.rollingpaper.DTO.PaperDTO.CreatePaperInfo; 5 | import com.threetier.team1.rollingpaper.DTO.PaperDTO.DeletePaperInfo; 6 | import com.threetier.team1.rollingpaper.DTO.PaperDTO.ShowListInfo; 7 | import com.threetier.team1.rollingpaper.domain.Paper; 8 | 9 | import java.util.List; 10 | 11 | public interface PaperService { 12 | List getList(); 13 | 14 | void write(CreatePaperInfo createPaperInfo); 15 | 16 | int delete(DeletePaperInfo deletePaperInfo); 17 | } 18 | -------------------------------------------------------------------------------- /ch10/my-diary-3/my-diary-back/rollingpaper/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | driver-class-name: com.mysql.cj.jdbc.Driver 4 | url: jdbc:mysql://rolling-db:3306/paperdb?serverTimezone=Asia/Seoul 5 | username: user 6 | password: user 7 | jpa: 8 | hibernate: 9 | ddl-auto: update 10 | properties: 11 | hibernate: 12 | show_sql: true 13 | format_sql: true 14 | database: mysql 15 | database-platform: org.hibernate.dialect.MySQL57InnoDBDialect 16 | level: 17 | org: 18 | hibernate: 19 | type: trace -------------------------------------------------------------------------------- /ch10/my-diary-3/my-diary-back/rollingpaper/src/test/java/com/threetier/team1/rollingpaper/RollingpaperApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.threetier.team1.rollingpaper; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class RollingpaperApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ch10/my-diary-3/my-diary-front/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:17-slim 2 | WORKDIR /home/node 3 | COPY ./ ./ 4 | RUN npm -y install 5 | EXPOSE 3000 6 | CMD ["npm","run","start"] 7 | -------------------------------------------------------------------------------- /ch10/my-diary-3/my-diary-front/fastcampus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch10/my-diary-3/my-diary-front/fastcampus.png -------------------------------------------------------------------------------- /ch10/my-diary-3/my-diary-front/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "test", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "app.js", 6 | "scripts": { 7 | "start": "node app.js", 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "bugs": { 13 | "url": "https://github.com/ksee1230/react-board-new/issues" 14 | }, 15 | "homepage": "https://github.com/ksee1230/react-board-new#readme", 16 | "dependencies": { 17 | "axios": "^0.27.2", 18 | "ejs": "^3.1.8", 19 | "express": "^4.18.1", 20 | "express-es6-template-engine": "^2.2.3" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /ch10/my-diary-3/my-diary-front/public/fastcampus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch10/my-diary-3/my-diary-front/public/fastcampus.png -------------------------------------------------------------------------------- /ch10/my-diary/my-diary-back/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM openjdk:11-jdk AS builder 2 | COPY ./rollingpaper/gradlew . 3 | COPY ./rollingpaper/gradle gradle 4 | COPY ./rollingpaper/build.gradle . 5 | COPY ./rollingpaper/settings.gradle . 6 | COPY ./rollingpaper/src src 7 | 8 | RUN chmod +x ./gradlew 9 | RUN ./gradlew bootJar 10 | 11 | FROM openjdk:11-jdk 12 | COPY --from=builder build/libs/*.jar app.jar 13 | 14 | EXPOSE 8080 15 | ENTRYPOINT ["java", "-jar", "/app.jar"] -------------------------------------------------------------------------------- /ch10/my-diary/my-diary-back/rollingpaper/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'org.springframework.boot' version '2.7.3' 3 | id 'io.spring.dependency-management' version '1.0.13.RELEASE' 4 | id 'java' 5 | } 6 | 7 | group = 'com.threetier.team1' 8 | version = '0.0.1-SNAPSHOT' 9 | sourceCompatibility = '11' 10 | 11 | configurations { 12 | compileOnly { 13 | extendsFrom annotationProcessor 14 | } 15 | } 16 | 17 | repositories { 18 | mavenCentral() 19 | } 20 | 21 | compileJava.options.encoding = 'UTF-8' 22 | tasks.withType(JavaCompile) { 23 | options.encoding = 'UTF-8' 24 | } 25 | 26 | dependencies { 27 | implementation 'org.springframework.boot:spring-boot-starter-data-jpa' 28 | implementation 'org.springframework.boot:spring-boot-starter-web' 29 | implementation 'org.springframework.boot:spring-boot-starter-validation' 30 | 31 | compileOnly 'org.projectlombok:lombok' 32 | runtimeOnly 'mysql:mysql-connector-java' 33 | annotationProcessor 'org.projectlombok:lombok' 34 | annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor' 35 | testImplementation 'org.springframework.boot:spring-boot-starter-test' 36 | } 37 | 38 | tasks.named('test') { 39 | useJUnitPlatform() 40 | } 41 | -------------------------------------------------------------------------------- /ch10/my-diary/my-diary-back/rollingpaper/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch10/my-diary/my-diary-back/rollingpaper/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /ch10/my-diary/my-diary-back/rollingpaper/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /ch10/my-diary/my-diary-back/rollingpaper/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'rollingpaper' 2 | -------------------------------------------------------------------------------- /ch10/my-diary/my-diary-back/rollingpaper/src/main/java/com/threetier/team1/rollingpaper/DTO/ApiResponseDTO.java: -------------------------------------------------------------------------------- 1 | package com.threetier.team1.rollingpaper.DTO; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Getter; 5 | 6 | @Getter 7 | @AllArgsConstructor 8 | public class ApiResponseDTO { 9 | private String message; 10 | } 11 | -------------------------------------------------------------------------------- /ch10/my-diary/my-diary-back/rollingpaper/src/main/java/com/threetier/team1/rollingpaper/RollingpaperApplication.java: -------------------------------------------------------------------------------- 1 | package com.threetier.team1.rollingpaper; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class RollingpaperApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(RollingpaperApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ch10/my-diary/my-diary-back/rollingpaper/src/main/java/com/threetier/team1/rollingpaper/domain/Paper.java: -------------------------------------------------------------------------------- 1 | package com.threetier.team1.rollingpaper.domain; 2 | 3 | import com.threetier.team1.rollingpaper.DTO.PaperDTO; 4 | import com.threetier.team1.rollingpaper.DTO.PaperDTO.CreatePaperInfo; 5 | import lombok.*; 6 | 7 | import javax.persistence.*; 8 | 9 | @Table(name = "paper") 10 | @Getter 11 | @Entity 12 | @NoArgsConstructor 13 | @AllArgsConstructor 14 | @Builder 15 | public class Paper { 16 | @Id 17 | @GeneratedValue(strategy = GenerationType.IDENTITY) 18 | private Long id; 19 | @Column(nullable = false) 20 | private String nickname; 21 | @Column(nullable = false) 22 | private String password; 23 | @Column(nullable = false) 24 | private String content; 25 | 26 | 27 | public static Paper fromDTO(CreatePaperInfo createPaperInfo) { 28 | return Paper.builder() 29 | .password(createPaperInfo.getPassword()) 30 | .nickname(createPaperInfo.getNickname()) 31 | .content(createPaperInfo.getContent()) 32 | .build(); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /ch10/my-diary/my-diary-back/rollingpaper/src/main/java/com/threetier/team1/rollingpaper/repository/PaperRepository.java: -------------------------------------------------------------------------------- 1 | package com.threetier.team1.rollingpaper.repository; 2 | 3 | import com.threetier.team1.rollingpaper.domain.Paper; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | import org.springframework.stereotype.Repository; 6 | 7 | @Repository 8 | public interface PaperRepository extends JpaRepository { 9 | } 10 | -------------------------------------------------------------------------------- /ch10/my-diary/my-diary-back/rollingpaper/src/main/java/com/threetier/team1/rollingpaper/service/PaperService.java: -------------------------------------------------------------------------------- 1 | package com.threetier.team1.rollingpaper.service; 2 | 3 | import com.threetier.team1.rollingpaper.DTO.PaperDTO; 4 | import com.threetier.team1.rollingpaper.DTO.PaperDTO.CreatePaperInfo; 5 | import com.threetier.team1.rollingpaper.DTO.PaperDTO.DeletePaperInfo; 6 | import com.threetier.team1.rollingpaper.DTO.PaperDTO.ShowListInfo; 7 | import com.threetier.team1.rollingpaper.domain.Paper; 8 | 9 | import java.util.List; 10 | 11 | public interface PaperService { 12 | List getList(); 13 | 14 | void write(CreatePaperInfo createPaperInfo); 15 | 16 | int delete(DeletePaperInfo deletePaperInfo); 17 | } 18 | -------------------------------------------------------------------------------- /ch10/my-diary/my-diary-back/rollingpaper/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | driver-class-name: com.mysql.cj.jdbc.Driver 4 | url: jdbc:mysql://rolling-db:3306/paperdb?serverTimezone=Asia/Seoul 5 | username: user 6 | password: user 7 | jpa: 8 | hibernate: 9 | ddl-auto: update 10 | properties: 11 | hibernate: 12 | show_sql: true 13 | format_sql: true 14 | database: mysql 15 | database-platform: org.hibernate.dialect.MySQL57InnoDBDialect 16 | level: 17 | org: 18 | hibernate: 19 | type: trace -------------------------------------------------------------------------------- /ch10/my-diary/my-diary-back/rollingpaper/src/test/java/com/threetier/team1/rollingpaper/RollingpaperApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.threetier.team1.rollingpaper; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class RollingpaperApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ch10/my-diary/my-diary-front/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:17-slim 2 | WORKDIR /home/node 3 | COPY ./ ./ 4 | RUN npm -y install 5 | EXPOSE 3000 6 | CMD ["npm","run","start"] 7 | -------------------------------------------------------------------------------- /ch10/my-diary/my-diary-front/fastcampus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch10/my-diary/my-diary-front/fastcampus.png -------------------------------------------------------------------------------- /ch10/my-diary/my-diary-front/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "test", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "app.js", 6 | "scripts": { 7 | "start": "node app.js", 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "bugs": { 13 | "url": "https://github.com/ksee1230/react-board-new/issues" 14 | }, 15 | "homepage": "https://github.com/ksee1230/react-board-new#readme", 16 | "dependencies": { 17 | "axios": "^0.27.2", 18 | "ejs": "^3.1.8", 19 | "express": "^4.18.1", 20 | "express-es6-template-engine": "^2.2.3" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /ch10/my-diary/my-diary-front/public/fastcampus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch10/my-diary/my-diary-front/public/fastcampus.png -------------------------------------------------------------------------------- /ch10/my-webdb/myweb-log/apache2/error.log: -------------------------------------------------------------------------------- 1 | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.28.0.3. Set the 'ServerName' directive globally to suppress this message 2 | [Thu Jul 06 00:21:43.595300 2023] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.56 (Debian) PHP/8.0.29 configured -- resuming normal operations 3 | [Thu Jul 06 00:21:43.595397 2023] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND' 4 | sh: 1: /usr/sbin/sendmail: not found 5 | [Thu Jul 06 00:56:59.090976 2023] [mpm_prefork:notice] [pid 1] AH00170: caught SIGWINCH, shutting down gracefully 6 | -------------------------------------------------------------------------------- /ch10/my-webdb/myweb-log/apache2/other_vhosts_access.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch10/my-webdb/myweb-log/apache2/other_vhosts_access.log -------------------------------------------------------------------------------- /ch10/nginx-compose/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | version: '3.8' 2 | services: 3 | pyfla_app1: 4 | build: 5 | context: ./pyfla_app1 6 | dockerfile: Dockerfile.app1 7 | ports: 8 | - "5001:5000" 9 | pyfla_app2: 10 | build: 11 | context: ./pyfla_app2 12 | dockerfile: Dockerfile.app2 13 | ports: 14 | - "5002:5000" 15 | pyfla_app3: 16 | build: 17 | context: ./pyfla_app3 18 | dockerfile: Dockerfile.app3 19 | ports: 20 | - "5003:5000" 21 | nginx: 22 | build: 23 | context: ./nginx_alb 24 | dockerfile: Dockerfile.alb 25 | ports: 26 | - "8080:80" 27 | depends_on: 28 | - pyfla_app1 29 | - pyfla_app2 30 | - pyfla_app3 31 | -------------------------------------------------------------------------------- /ch10/nginx-compose/nginx_alb/Dockerfile.alb: -------------------------------------------------------------------------------- 1 | FROM nginx:1.25.1-alpine 2 | RUN rm /etc/nginx/conf.d/default.conf 3 | COPY nginx.conf /etc/nginx/conf.d/default.conf 4 | -------------------------------------------------------------------------------- /ch10/nginx-compose/nginx_alb/nginx.conf: -------------------------------------------------------------------------------- 1 | upstream web-alb { 2 | server 172.17.0.1:5001; 3 | server 172.17.0.1:5002; 4 | server 172.17.0.1:5003; 5 | } 6 | 7 | server { 8 | location / { 9 | proxy_pass http://web-alb; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ch10/nginx-compose/pyfla_app1/Dockerfile.app1: -------------------------------------------------------------------------------- 1 | FROM python:3.10-slim 2 | COPY requirements.txt /requirements.txt 3 | WORKDIR / 4 | RUN pip install -r requirements.txt 5 | COPY . / 6 | ENTRYPOINT [ "python3" ] 7 | CMD [ "/pyfla_app1.py" ] 8 | -------------------------------------------------------------------------------- /ch10/nginx-compose/pyfla_app1/pyfla_app1.py: -------------------------------------------------------------------------------- 1 | from flask import request, Flask 2 | import json 3 | 4 | app1 = Flask(__name__) 5 | 6 | @app1.route('/') 7 | def hello_world(): 8 | return 'Flask Web Application [1]' + '\n' 9 | 10 | if __name__ == '__main__': 11 | app1.run(debug=True, host='0.0.0.0') 12 | -------------------------------------------------------------------------------- /ch10/nginx-compose/pyfla_app1/requirements.txt: -------------------------------------------------------------------------------- 1 | Flask 2 | -------------------------------------------------------------------------------- /ch10/nginx-compose/pyfla_app2/Dockerfile.app2: -------------------------------------------------------------------------------- 1 | FROM python:3.10-slim 2 | COPY requirements.txt /requirements.txt 3 | WORKDIR / 4 | RUN pip install -r requirements.txt 5 | COPY . / 6 | ENTRYPOINT [ "python3" ] 7 | CMD [ "/pyfla_app2.py" ] 8 | -------------------------------------------------------------------------------- /ch10/nginx-compose/pyfla_app2/pyfla_app2.py: -------------------------------------------------------------------------------- 1 | from flask import request, Flask 2 | import json 3 | 4 | app2 = Flask(__name__) 5 | 6 | @app2.route('/') 7 | def hello_world(): 8 | return 'Flask Web Application [2]' + '\n' 9 | 10 | if __name__ == '__main__': 11 | app2.run(debug=True, host='0.0.0.0') 12 | -------------------------------------------------------------------------------- /ch10/nginx-compose/pyfla_app2/requirements.txt: -------------------------------------------------------------------------------- 1 | Flask 2 | -------------------------------------------------------------------------------- /ch10/nginx-compose/pyfla_app3/Dockerfile.app3: -------------------------------------------------------------------------------- 1 | FROM python:3.10-slim 2 | COPY requirements.txt /requirements.txt 3 | WORKDIR / 4 | RUN pip install -r requirements.txt 5 | COPY . / 6 | ENTRYPOINT [ "python3" ] 7 | CMD [ "/pyfla_app3.py" ] 8 | -------------------------------------------------------------------------------- /ch10/nginx-compose/pyfla_app3/pyfla_app3.py: -------------------------------------------------------------------------------- 1 | from flask import request, Flask 2 | import json 3 | 4 | app3 = Flask(__name__) 5 | 6 | @app3.route('/') 7 | def hello_world(): 8 | return 'Flask Web Application [3]' + '\n' 9 | 10 | if __name__ == '__main__': 11 | app3.run(debug=True, host='0.0.0.0') 12 | -------------------------------------------------------------------------------- /ch10/nginx-compose/pyfla_app3/requirements.txt: -------------------------------------------------------------------------------- 1 | Flask 2 | -------------------------------------------------------------------------------- /ch10/notepad10.txt: -------------------------------------------------------------------------------- 1 | # ch10 2 | -------------------------------------------------------------------------------- /ch10/web-count/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.10-slim 2 | 3 | LABEL maintainer "kevin.lee" 4 | 5 | RUN pip install --upgrade pip 6 | RUN mkdir -p /cloud-web/image 7 | 8 | ENV APP_PATH /cloud-web/image 9 | 10 | COPY requirements.txt $APP_PATH/ 11 | RUN pip install --no-cache-dir -r $APP_PATH/requirements.txt 12 | 13 | COPY app.py $APP_PATH/ 14 | COPY templates/ $APP_PATH/templates/ 15 | COPY static/ $APP_PATH/static/ 16 | 17 | EXPOSE 8899 18 | 19 | CMD ["python", "/cloud-web/image/app.py"] 20 | -------------------------------------------------------------------------------- /ch10/web-count/app.py: -------------------------------------------------------------------------------- 1 | from flask import Flask, render_template 2 | from redis import Redis 3 | import os,random 4 | 5 | app = Flask(__name__) 6 | redis = Redis(host='redis', port=6379) 7 | 8 | images = [ 9 | "cloud-01.png", 10 | "cloud-02.png", 11 | "cloud-03.png", 12 | "cloud-04.png", 13 | "cloud-05.png", 14 | "docker_logo.png", 15 | "k8s_logo.png" 16 | ] 17 | 18 | @app.route('/') 19 | def index(): 20 | image_path = "/static/images/" + random.choice(images) 21 | 22 | count = redis.incr('count') 23 | return render_template('index.html', image_path=image_path, visit_count=count) 24 | 25 | if __name__ == "__main__": 26 | app.run(host="0.0.0.0", port=8899) 27 | -------------------------------------------------------------------------------- /ch10/web-count/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.8' 2 | services: 3 | webserver: 4 | build: . 5 | ports: 6 | - "8899:8899" 7 | depends_on: 8 | - redis 9 | 10 | redis: 11 | image: redis:6.0 12 | -------------------------------------------------------------------------------- /ch10/web-count/requirements.txt: -------------------------------------------------------------------------------- 1 | Flask 2 | redis 3 | -------------------------------------------------------------------------------- /ch10/web-count/static/images/cloud-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch10/web-count/static/images/cloud-01.png -------------------------------------------------------------------------------- /ch10/web-count/static/images/cloud-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch10/web-count/static/images/cloud-02.png -------------------------------------------------------------------------------- /ch10/web-count/static/images/cloud-03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch10/web-count/static/images/cloud-03.png -------------------------------------------------------------------------------- /ch10/web-count/static/images/cloud-04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch10/web-count/static/images/cloud-04.png -------------------------------------------------------------------------------- /ch10/web-count/static/images/cloud-05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch10/web-count/static/images/cloud-05.png -------------------------------------------------------------------------------- /ch10/web-count/static/images/docker_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch10/web-count/static/images/docker_logo.png -------------------------------------------------------------------------------- /ch10/web-count/static/images/fastcampus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch10/web-count/static/images/fastcampus.png -------------------------------------------------------------------------------- /ch10/web-count/static/images/k8s_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch10/web-count/static/images/k8s_logo.png -------------------------------------------------------------------------------- /ch10/web-count/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Fastcampus Docker Container Service 6 | 7 | 8 | 9 | 10 | 11 | 12 | 16 | 17 |
18 |
19 | 22 |
23 | 24 |
25 | 26 |
27 |
28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /ch11/haproxy-nginx/haproxy-web-stack.yaml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | services: 3 | nginx: 4 | image: nginx:1.25.0-alpine 5 | deploy: 6 | replicas: 4 # 복제 * 4 7 | placement: 8 | constraints: [node.role != manager] # manager node가 아닌 node에 배치 9 | restart_policy: 10 | condition: on-failure 11 | max_attempts: 3 12 | environment: 13 | SERVICE_PORTS: 80 14 | networks: 15 | - haproxy-web 16 | proxy: 17 | image: dbgurum/haproxy:1.0 # 사전에 구성해 놓은 haproxy.cfg 포함 18 | depends_on: 19 | - nginx # nginx service와 의존성 20 | volumes: 21 | - /var/run/docker.sock:/var/run/docker.sock 22 | ports: 23 | - 80:80 24 | networks: 25 | - haproxy-web 26 | deploy: 27 | mode: global # 모든 노드에 task 배치 28 | placement: 29 | constraints: [node.role == manager] # manager node에만.. 30 | 31 | networks: 32 | haproxy-web: 33 | external: true 34 | -------------------------------------------------------------------------------- /ch11/notepad11.txt: -------------------------------------------------------------------------------- 1 | # ch11 2 | -------------------------------------------------------------------------------- /ch11/webapi-stack.yaml: -------------------------------------------------------------------------------- 1 | version: "3.8" 2 | services: 3 | webAPI: 4 | image: nginx:1.25.1-alpine 5 | ports: 6 | - '8080:80' 7 | deploy: 8 | replicas: 3 9 | -------------------------------------------------------------------------------- /ch12/notepad12.txt: -------------------------------------------------------------------------------- 1 | # ch12 2 | -------------------------------------------------------------------------------- /ch13/django/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:18.04 2 | RUN apt-get update && \ 3 | apt install -y software-properties-common &&\ 4 | apt-get install --no-install-recommends -y \ 5 | python3.8 python3-pip python3.8-dev &&\ 6 | apt-get install gcc -y 7 | RUN /usr/bin/python3.8 -m pip install --upgrade pip 8 | RUN ln -s /usr/bin/python3.8 /usr/bin/python 9 | 10 | RUN pip install -U setuptools 11 | RUN pip install django==3.2 asgiref==3.3.3 gunicorn==20.0.4 setproctitle==1.1.10 12 | RUN pip install django-common-models phonenumbers 13 | 14 | COPY ./app /app 15 | RUN chown -R root:root /app 16 | RUN chmod -R +x /app/bin 17 | RUN chmod -R +x /app/cmd 18 | 19 | WORKDIR /app/larva 20 | RUN echo yes | python manage.py collectstatic 21 | 22 | WORKDIR /app 23 | 24 | VOLUME /app 25 | 26 | ENTRYPOINT [ "/app/cmd/start" ] 27 | 28 | EXPOSE 8000 29 | -------------------------------------------------------------------------------- /ch13/django/app/cmd/start: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | python /app/larva/manage.py makemigrations 3 | python /app/larva/manage.py migrate --noinput 4 | /app/bin/gunicorn_start 5 | -------------------------------------------------------------------------------- /ch13/django/app/larva/common/__pycache__/admin.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch13/django/app/larva/common/__pycache__/admin.cpython-310.pyc -------------------------------------------------------------------------------- /ch13/django/app/larva/common/__pycache__/apps.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch13/django/app/larva/common/__pycache__/apps.cpython-310.pyc -------------------------------------------------------------------------------- /ch13/django/app/larva/common/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from .models import * 3 | # Register your models here. 4 | admin.site.register(Item) 5 | admin.site.register(User) 6 | admin.site.register(Charge) 7 | admin.site.register(Reservation) 8 | 9 | -------------------------------------------------------------------------------- /ch13/django/app/larva/common/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | from django.shortcuts import render 3 | 4 | class CommonConfig(AppConfig): 5 | default_auto_field = 'django.db.models.BigAutoField' 6 | name = 'common' 7 | 8 | def index(request): 9 | return render(request, 'index.html') 10 | -------------------------------------------------------------------------------- /ch13/django/app/larva/common/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | 3 | def index(request): 4 | return render(request, 'common/index.html') 5 | 6 | -------------------------------------------------------------------------------- /ch13/django/app/larva/larva/__pycache__/settings.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch13/django/app/larva/larva/__pycache__/settings.cpython-310.pyc -------------------------------------------------------------------------------- /ch13/django/app/larva/larva/asgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | ASGI config for larva project. 3 | 4 | It exposes the ASGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.2/howto/deployment/asgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.asgi import get_asgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'larva.settings') 15 | 16 | application = get_asgi_application() 17 | -------------------------------------------------------------------------------- /ch13/django/app/larva/larva/test_runner.py: -------------------------------------------------------------------------------- 1 | from django.test.runner import DiscoverRunner 2 | 3 | class TestRunner(DiscoverRunner): 4 | 5 | def setup_databases(self, **kwargs): 6 | pass 7 | 8 | def teardown_databases(self, old_config, **kwargs): 9 | pass -------------------------------------------------------------------------------- /ch13/django/app/larva/larva/urls.py: -------------------------------------------------------------------------------- 1 | """larva URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/3.2/topics/http/urls/ 5 | Examples: 6 | Function views 7 | 1. Add an import: from my_app import views 8 | 2. Add a URL to urlpatterns: path('', views.home, name='home') 9 | Class-based views 10 | 1. Add an import: from other_app.views import Home 11 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') 12 | Including another URLconf 13 | 1. Import the include() function: from django.urls import include, path 14 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) 15 | """ 16 | 17 | from django.contrib import admin 18 | from django.urls import path, include 19 | from larva.views import index 20 | 21 | 22 | urlpatterns = [ 23 | path('admin/', admin.site.urls), 24 | #path('', include('common.urls')), 25 | path('', index, name='index'), 26 | ] 27 | 28 | -------------------------------------------------------------------------------- /ch13/django/app/larva/larva/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | 3 | def index(request): 4 | return render(request, 'common/index.html') 5 | 6 | -------------------------------------------------------------------------------- /ch13/django/app/larva/larva/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for larva project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'larva.settings') 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /ch13/django/app/larva/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """Django's command-line utility for administrative tasks.""" 3 | import os 4 | import sys 5 | 6 | 7 | def main(): 8 | """Run administrative tasks.""" 9 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'larva.settings') 10 | try: 11 | from django.core.management import execute_from_command_line 12 | except ImportError as exc: 13 | raise ImportError( 14 | "Couldn't import Django. Are you sure it's installed and " 15 | "available on your PYTHONPATH environment variable? Did you " 16 | "forget to activate a virtual environment?" 17 | ) from exc 18 | execute_from_command_line(sys.argv) 19 | 20 | 21 | if __name__ == '__main__': 22 | main() 23 | -------------------------------------------------------------------------------- /ch13/django/app/larva/static/common/css/base.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | src : url("../fonts/NanumBarunGothic.ttf"); 3 | font-family: "NanumBarunGothic" 4 | } 5 | 6 | body { 7 | font-family: 'NanumBarunGothic', sans-serif; 8 | letter-spacing: 0.07ex; 9 | } 10 | 11 | .container_box { 12 | display: flex; 13 | justify-content: flex-start; 14 | flex-direction: column; 15 | align-items: center; 16 | } -------------------------------------------------------------------------------- /ch13/django/app/larva/static/common/css/index.css: -------------------------------------------------------------------------------- 1 | h1 { 2 | color: rgb(0, 150, 0); 3 | } 4 | 5 | .container { 6 | max-width: 375px; 7 | display: flex; 8 | justify-content: flex-start; 9 | flex-direction: column; 10 | align-items: center; 11 | } 12 | 13 | .menu { 14 | display: flex; 15 | justify-content: center; 16 | flex-direction: row; 17 | margin-bottom: 20px; 18 | } 19 | 20 | #disposal { 21 | width: 100%; 22 | } 23 | 24 | #catalog { 25 | margin-top: 3px; 26 | width: 100%; 27 | } 28 | 29 | #logo_main { 30 | width: 100%; 31 | margin-top: 50px; 32 | margin-bottom: 100px; 33 | } 34 | 35 | .interval { 36 | width: 20%; 37 | } 38 | 39 | .logo_button { 40 | width: 21%; 41 | } -------------------------------------------------------------------------------- /ch13/django/app/larva/static/common/fastcampus.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch13/django/app/larva/static/common/fastcampus.ico -------------------------------------------------------------------------------- /ch13/django/app/larva/static/common/fonts/NanumBarunGothic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch13/django/app/larva/static/common/fonts/NanumBarunGothic.ttf -------------------------------------------------------------------------------- /ch13/django/app/larva/static/common/fonts/NanumBarunGothicBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch13/django/app/larva/static/common/fonts/NanumBarunGothicBold.ttf -------------------------------------------------------------------------------- /ch13/django/app/larva/static/common/fonts/NanumBarunGothicLight.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch13/django/app/larva/static/common/fonts/NanumBarunGothicLight.ttf -------------------------------------------------------------------------------- /ch13/django/app/larva/static/common/fonts/NanumBarunGothicUltraLight.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch13/django/app/larva/static/common/fonts/NanumBarunGothicUltraLight.ttf -------------------------------------------------------------------------------- /ch13/django/app/larva/static/common/img/logo_list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch13/django/app/larva/static/common/img/logo_list.png -------------------------------------------------------------------------------- /ch13/django/app/larva/static/common/img/logo_main_fast.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch13/django/app/larva/static/common/img/logo_main_fast.png -------------------------------------------------------------------------------- /ch13/django/app/larva/static/common/img/logo_reservation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch13/django/app/larva/static/common/img/logo_reservation.png -------------------------------------------------------------------------------- /ch13/django/app/larva/templates/common/base.html: -------------------------------------------------------------------------------- 1 | {% load static %} 2 | 3 | 4 | 5 | 6 | 7 | fastcampus Docker -kevin- 8 | 9 | 10 | {% block css %} 11 | {% endblock css %} 12 | 13 | 14 | 15 |
16 | {% block content %} 17 | {% endblock content %} 18 | 19 | {% block js %} 20 | {% endblock js %} 21 |
22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /ch13/django/app/larva/templates/common/index.html: -------------------------------------------------------------------------------- 1 | {% extends "common/base.html" %} 2 | {% load static %} 3 | 4 | {% block css %} 5 | 6 | {% endblock css %} 7 | 8 | {% block content %} 9 |
10 | app main logo 11 | 21 |
22 | {% endblock content %} 23 | -------------------------------------------------------------------------------- /ch13/nginx/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginx:1.23.1-alpine 2 | WORKDIR /etc/nginx/ 3 | RUN rm /etc/nginx/conf.d/default.conf 4 | COPY nginx.conf /etc/nginx/conf.d/ 5 | EXPOSE 80 6 | -------------------------------------------------------------------------------- /ch13/notepad13.txt: -------------------------------------------------------------------------------- 1 | # ch13 2 | -------------------------------------------------------------------------------- /ch14/notepad14.txt: -------------------------------------------------------------------------------- 1 | # ch14 2 | -------------------------------------------------------------------------------- /ch14/web-count/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.10-slim 2 | 3 | LABEL maintainer "kevin.lee" 4 | 5 | RUN pip install --upgrade pip 6 | RUN mkdir -p /cloud-web/image 7 | 8 | ENV APP_PATH /cloud-web/image 9 | 10 | COPY requirements.txt $APP_PATH/ 11 | RUN pip install --no-cache-dir -r $APP_PATH/requirements.txt 12 | 13 | COPY app.py $APP_PATH/ 14 | COPY templates/ $APP_PATH/templates/ 15 | COPY static/ $APP_PATH/static/ 16 | 17 | EXPOSE 8899 18 | 19 | CMD ["python", "/cloud-web/image/app.py"] 20 | -------------------------------------------------------------------------------- /ch14/web-count/Jenkinsfile: -------------------------------------------------------------------------------- 1 | node { 2 | stage('Clone repository') { 3 | git credentialsId: 'github_access_token', url: 'https://github.com/hylee-kevin/web-count.git' 4 | } 5 | 6 | stage('Build image') { 7 | dockerImage = docker.build("leecloud/web_count:v1.0") 8 | } 9 | 10 | stage('Push image') { 11 | withDockerRegistry([ credentialsId: "docker-access", url: "" ]) { 12 | dockerImage.push() 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /ch14/web-count/app.py: -------------------------------------------------------------------------------- 1 | from flask import Flask, render_template 2 | from redis import Redis 3 | import os,random 4 | 5 | app = Flask(__name__) 6 | redis = Redis(host='redis', port=6379) 7 | 8 | images = [ 9 | "cloud-01.png", 10 | "cloud-02.png", 11 | "cloud-03.png", 12 | "cloud-04.png", 13 | "cloud-05.png", 14 | "docker_logo.png", 15 | "fastcampus.png", 16 | "k8s_logo.png" 17 | ] 18 | 19 | @app.route('/') 20 | def index(): 21 | image_path = "/static/images/" + random.choice(images) 22 | 23 | count = redis.incr('count') 24 | return render_template('index.html', image_path=image_path, visit_count=count) 25 | 26 | if __name__ == "__main__": 27 | app.run(host="0.0.0.0", port=8899) 28 | -------------------------------------------------------------------------------- /ch14/web-count/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.8' 2 | services: 3 | webserver: 4 | build: . 5 | ports: 6 | - "8899:8899" 7 | depends_on: 8 | - redis 9 | 10 | redis: 11 | image: redis:6.0 12 | -------------------------------------------------------------------------------- /ch14/web-count/docker-compose.yml.2: -------------------------------------------------------------------------------- 1 | version: '3.3' 2 | services: 3 | webserver: 4 | image: leecloudo/web_count:1.0 5 | ports: 6 | - "8899:8899" 7 | depends_on: 8 | - redis 9 | 10 | redis: 11 | image: redis:6.0 12 | -------------------------------------------------------------------------------- /ch14/web-count/requirements.txt: -------------------------------------------------------------------------------- 1 | Flask 2 | redis 3 | -------------------------------------------------------------------------------- /ch14/web-count/static/images/cloud-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch14/web-count/static/images/cloud-01.png -------------------------------------------------------------------------------- /ch14/web-count/static/images/cloud-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch14/web-count/static/images/cloud-02.png -------------------------------------------------------------------------------- /ch14/web-count/static/images/cloud-03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch14/web-count/static/images/cloud-03.png -------------------------------------------------------------------------------- /ch14/web-count/static/images/cloud-04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch14/web-count/static/images/cloud-04.png -------------------------------------------------------------------------------- /ch14/web-count/static/images/cloud-05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch14/web-count/static/images/cloud-05.png -------------------------------------------------------------------------------- /ch14/web-count/static/images/docker_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch14/web-count/static/images/docker_logo.png -------------------------------------------------------------------------------- /ch14/web-count/static/images/fastcampus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch14/web-count/static/images/fastcampus.png -------------------------------------------------------------------------------- /ch14/web-count/static/images/k8s_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hylee-kevin/fastcampus/9392ca8ef72887534793735e6c929facb111893b/ch14/web-count/static/images/k8s_logo.png -------------------------------------------------------------------------------- /ch14/web-count/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Fastcampus Docker Container Service 6 | 7 | 8 | 9 | 10 | 11 | 12 | 16 | 17 |
18 |
19 | 22 |

[Jenkins Deploy test -----> Version 1]

23 |
24 | 25 |
26 | 27 |
28 |
29 | 30 | 31 | 32 | 33 | --------------------------------------------------------------------------------