This is the S2IT Challenge 2018
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
This project require Composer, Symfony 2.8 and mysql db
-
clone this repository
-
go to path/your/project
-
$ composer install
-
configure the database
#app/config/parameters.yml
parameters:
database_host: localhost
database_name: s2it_test
database_user: root
database_password:
-
run a mysql service
-
$ php app/console doctrine:database:create
-
$ php app/console doctrine:schema:update --force
-
$ php app/console server:run
Go to localhost:8000 in your browser to send yours files
sample of files format accepted:
<?xml version="1.0" encoding="UTF-8"?>
<product type="car">
<name>Fusca</name>
<brand>Volkswagen</brand>
<color>White</color>
<year>1970</year>
</product>
OR
<?xml version="1.0" encoding="UTF-8"?>
<product type="cellphone">
<brand>Motorola</brand>
<model>Z3</model>
<color>black</color>
</product>
Go to the localhost:8000/api/doc
To register a new user, enable the below line:
# - { path: ^/api/users/new, roles: [IS_AUTHENTICATED_ANONYMOUSLY] }
and send a request from localhost:8000/api/doc (/api/users/new) or you can use the postman to test the api
body request to register a new user:
{
"name":"User Test",
"username": "usertest",
"password": 123123
}
body request to get a auth token
{
"username": "usertest",
"password": "123123"
}
$ path/your/project/bin/simple-phpnuit -c ../app
Free