Skip to content

Commit

Permalink
Added Makefile (#4)
Browse files Browse the repository at this point in the history
Fixes #4
  • Loading branch information
teezzan committed Apr 12, 2023
1 parent b965bb6 commit c5f06cf
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 5 deletions.
35 changes: 35 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
PROJECT_NAME:= kitty-facty

.PHONY: all
all: help

.PHONY: help
help:
@echo "------------------------------------------------------------------------"
@echo "${PROJECT_NAME}"
@echo "------------------------------------------------------------------------"
@grep -E '^[a-zA-Z0-9_/%\-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

.PHONY: serve
serve: ## Run locally
npm run dev

.PHONY: build
build: lint ## Build application binaries
npm run build

.PHONY: lint
lint: ## Run linters
npm run lint

.PHONY: test
test: lint ## Run unit tests
npm run test

.PHONY: image
image: ## Create Docker image
docker build -t kitty-facty .

.PHONY: docker-up
docker-up: ## Start docker image
docker run -p 3000:3000 kitty-facty
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ GET /api/facts?perPage=3&page=21&sortByLength=desc&sortByAlphabet=asc&maxLength=

### **Sample Response**

```bash
```javascript
HTTP/1.1 200 OK
Content-Type: application/json

Expand Down Expand Up @@ -91,8 +91,8 @@ Content-Type: application/json

To run tests:

```javascript
npm run test
```bash
make test
```

## Docker
Expand All @@ -102,13 +102,13 @@ To build and run the application using Docker:
- Build the Docker image:

```bash
docker build -t kitty-facty .
make build
```

- Run the Docker container:

```bash
docker run -p 3000:3000 kitty-facty
make docker-up
```

## License
Expand Down

1 comment on commit c5f06cf

@vercel
Copy link

@vercel vercel bot commented on c5f06cf Apr 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

kitty-facty – ./

kitty-facty.vercel.app
kitty-facty-git-main-teezzan.vercel.app
kitty-facty-teezzan.vercel.app

Please sign in to comment.