Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ module.exports = {
};

function kickable (it) {
return it == "it" ? true : false;
return it && it.toUpperCase() == "IT" ? true : false;
}
10 changes: 8 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@

const Koa = require('koa');
const route = require('koa-route');
const api = require('./api')
const logger = require('koa-logger');

const api = require('./api');

const app = new Koa();
const port = process.env.PORT || 3000;

app.use(logger())
app.use(route.get('/kick/:it', api.kick));

app.listen(3000);
app.listen(port);

console.log(`kickable now running on port ${port}`);
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@
"test": "ava -v",
"cover": "nyc npm run test",
"report": "npm run codecov & npm run coveralls",
"codecov": "./node_modules/.bin/nyc report --reporter=lcov | ./node_modules/.bin/codecov -B $(date \"+%Y%m%d%H%M%S\")",
"codecov": "./node_modules/.bin/nyc report --reporter=lcov | ./node_modules/.bin/codecov -B $(date \"+%Y%m%d%H%M%S\")",
"coveralls": "./node_modules/.bin/nyc report --reporter=text-lcov | ./node_modules/.bin/coveralls"
},
"author": "",
"license": "ISC",
"dependencies": {
"koa": "^2.2.0",
"koa-logger": "^2.0.1",
"koa-route": "^3.2.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion test/api-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ test("successful", (t) => {
t.is(res.body, true)
});

test.skip("case sensitive", (t) => {
test("case sensitive", (t) => {
const res = kick("IT")
t.is(res.body, true)
});