Skip to content

wataori/codecheck-854

Repository files navigation

Circle CI

Make your own portfolio!

This challenge assume that there is a server hosted by Heroku. Please make a new application for this challenge in Heroku.

Database

Information for this challenge is specified in below. It is also provided in database.sql file.

-- This file is formatted based on SQLite3's syntax
-- Some small fixes might be needed to use in other database.
create table projects (
    id integer PRIMARY KEY AUTOINCREMENT,
    url varchar(255) NULL,
    title varchar(255) NOT NULL,
    description text NOT NULL,
    created_at datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
  );

Step 1: Edit account.json

Open account.json and edit the value for heroku_appname to the application that you have hosted.

{
  "heroku_appname": "<App Name>"
}

Replace <App Name>, including < and >, to your application name.

Step 2: Implement your server and check with Test!

We require to implement 4 endpoints. All details of specifications are written in files with format of api-first-spec.

  • GET /api/projects
  • POST /api/projects
    • Return 400 BadRequest when either of title or description was empty
    • Return 200 OK when server succeed to create new data
    • POST /api/projects spec
  • GET /api/projects/:id
  • DELETE /api/projects/:id

Run Test

To test your API server in local environment, run commands in below.

$ npm install                               # Install modules (You need run this at first time)
$ $(npm bin)/mocha specifications/localhost # Run Test in local

Make all test status as passing; there are several failing tests at beginning.

42 passing (16s)
6 failing

Step 3: Hack as you want!

As long as our tests pass, it is free to hack in your own way! Please write features that you add and your thoughts about why / how you add that features to answer.md.

If you are back-end developer, adding validation, new parameter, or implement new endpoints would be a good option to show your skills. For front-end developer, implement front page using the API that you have implemented.

Releases

No releases published

Packages

No packages published