Tuesday, December 15, 2020

Docker Github Container Registry Login

$ cat ~/personal_full.txt | docker login http://ghcr.io -u maximilianou --password-stdin
Login Succeeded

$ docker tag bf756fb1ae65 ghcr.io/maximilianou/node-lts-alpine:v14 

$ docker push ghcr.io/maximilianou/node-lts-alpine:v14

https://github.com/users/maximilianou/packages/container/package/node-lts-alpine


$ docker pull ghcr.io/maximilianou/node-lts-alpine:v14


FROM ghcr.io/maximilianou/node-lts-alpine:v14

Wednesday, December 9, 2020

Typescript - nodejs 2020 december

api/safeFetch.ts

  • Code:

maximilianou@instrument:~/projects/weekly20$ cat api/safeFetch.ts 


import * as TE from "fp-ts/lib/TaskEither";
import * as E from "fp-ts/lib/Either";
const fetch = require('node-fetch');

type User = {

};

export const safeFetch = (
  url: string,
  errMessage: string
): TE.TaskEither> => 
     TE.tryCatch(
       () => fetch(url).then( res => res.json()),
       () => new Error(errMessage)
     );

safeFetch(
  "https://jsonplaceholder.typicode.com/users",
  "failed to fetch users"
)().then(E.fold(console.error, console.log));

  • Run code, over command line:

maximilianou@instrument:~/projects/weekly20/api$ ./node_modules/.bin/ts-node safeFetch.ts

Tuesday, December 1, 2020

Public Learning: Work in progress

Work in progress

https://github.com/maximilianou/weekly20/

Typescript

React

Docker

docker-compose

nginx - loadbalancer - localmachine

planning to learn Github Action

planning to learn AWS