Skip to content

set up for Api with two endpoints#197

Open
bnokoro wants to merge 1 commit into
Dufuna-CodeCamp:masterfrom
bnokoro:slimPhpTask
Open

set up for Api with two endpoints#197
bnokoro wants to merge 1 commit into
Dufuna-CodeCamp:masterfrom
bnokoro:slimPhpTask

Conversation

@bnokoro
Copy link
Copy Markdown
Contributor

@bnokoro bnokoro commented Apr 28, 2020

Intoduction to slim php task

I created a database.sql file to query my database and embedded as part of my slim Api
I created two endpoints for the api, one for adding products, the other for listing products
I also added a readme to show the endpoints for the api

@kenny-wealth
Copy link
Copy Markdown
Contributor

Nice work, Blessing. We can make this PR to be even "slimmer". I will comment on files that I think are not needed for this task and you should be able to delete those

@@ -0,0 +1 @@
json_path: coveralls-upload.json
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this task is not focused on continuous integration, so this file can go

@@ -0,0 +1,24 @@
language: php
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this task is not focused on continuous integration, so this file can go

@@ -0,0 +1,14 @@
# How to Contribute
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

please remove this as you are the sole contributor on this project

@@ -0,0 +1,3 @@
http://localhost:8888/welcome/ #Home endpoint
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good job adding this! Also add the expected http method for each endpoint, and sample requests

return function (ContainerBuilder $containerBuilder) {
// Here we map our UserRepository interface to its in memory implementation
$containerBuilder->addDefinitions([
UserRepository::class => \DI\autowire(InMemoryUserRepository::class),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we'll be removing all User related files and their references

@@ -0,0 +1,88 @@
<?php
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

delete this too

@@ -0,0 +1,11 @@
<?php
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

delete

@@ -0,0 +1,19 @@
<?php
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

delete

@@ -0,0 +1,40 @@
<?php
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

not needed

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Everything in tests folder actually should go. Unless you wrote tests for your api?

@@ -0,0 +1,52 @@
<?php
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

not needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants