- Download repo
- run
npm install
- create a
.env
file - run
npm run start
- Use
npm install
to populate thenode_modules/
directory with up-to-date packages - Create a file called
.env
, following the instructions in the section below - Go to https://dbadmin.csse.canterbury.ac.nz and create a database with the name that you set in the
.env
file - Run
npm run start
ornpm run debug
to start the server - The server will be accessible on
localhost:4941
Create a .env
file in the root directory of this project including the following information (note that you will need to create the database first in phpMyAdmin):
SENG365_MYSQL_HOST=db2.csse.canterbury.ac.nz
SENG365_MYSQL_USER={your usercode}
SENG365_MYSQL_PASSWORD={your password}
SENG365_MYSQL_DATABASE={a database starting with your usercode then an underscore}
For example:
SENG365_MYSQL_HOST=db2.csse.canterbury.ac.nz
SENG365_MYSQL_USER=abc123
SENG365_MYSQL_PASSWORD=password
SENG365_MYSQL_DATABASE=abc123_s365
There is a Postman collection provided to you and can be run as a 'collection' to test your application. These are a subset of the full set of tests that will be used to mark your assignment. (Note that a different set of data will be used for marking.)
For more information regarding the Postman suite refer to README.md file in the /app/resources/postman folder
You should set up your application to store files in the storage/photos
directory; this is where the photos used for the sample data are copied into when you run a /resample
or /reload
request. There will initially be a file called .gitkeep
in there; this is just so that the directory gets included in the git repository (see https://stackoverflow.com/q/7229885/8355496 for more information).
To enable autocomplete for database tables, columns, etc., you can connect WebStorm to the db2
database by following the instructions at https://www.jetbrains.com/help/idea/connecting-to-a-database.html#connect-to-mysql-database. The details to enter are:
- Host:
db2.csse.canterbury.ac.nz
- Port:
3306
- User: (your usercode)
- Password: (your password)
- Database: (your database, as in
.env
)
The api spec provides several status codes that each endpoint can return. Apart from the 500 'Internal Server Error' each of these represents a flow that may be tested. Hopefully from the labs you have seen these status codes before and have an understanding of what each represents. A brief overview is provided in the table below.
Status Code | Status Message | Description | Example |
---|---|---|---|
200 | OK | Request completed successfully | Successfully get auctions |
201 | Created | Resources created successfully | Successfully create auction |
400 | Bad Request | The request failed due to client error | Creating an auction without a request body |
401 | Unauthorised | The requested failed due invalid authorisation | Creating an auction without authorisation header |
403 | Forbidden | The request is refused by the server | Deleting an auction after a bid has been placed |
The Postman collection provided is a subset of what you will be marked with so passing these tests should be your highest
priority. If you find an inconsistency or issue with the reference server please reach out to Morgan English
[email protected]
.