Skip to content

Commit

Permalink
Updates Node. Switches to markdown-it
Browse files Browse the repository at this point in the history
  • Loading branch information
zrrrzzt committed Nov 4, 2017
1 parent b214cf9 commit 88107e4
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 12 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -42,3 +42,6 @@ jspm_packages

# Optional REPL history
.node_repl_history

# Lock files
package-lock.json
4 changes: 2 additions & 2 deletions Dockerfile
@@ -1,5 +1,5 @@
# Setting the base to nodejs 7.8.0
FROM node:7.8.0-alpine
# Setting the base to nodejs 8.9.0
FROM node:8.9.0-alpine

# Maintainer
MAINTAINER Geir Gåsodden
Expand Down
5 changes: 2 additions & 3 deletions index.js
@@ -1,7 +1,7 @@
'use strict'

const readFileSync = require('fs').readFileSync
const marked = require('marked')
const md = require('markdown-it')()
const { parse } = require('url')
const { send, json } = require('micro')
const getCountry = require('./lib/get-country')
Expand All @@ -16,7 +16,6 @@ module.exports = async (request, response) => {
send(response, 200, results)
} else {
const readme = readFileSync('./README.md', 'utf-8')
const html = marked(readme)
send(response, 200, html)
send(response, 200, md.render(readme))
}
}
14 changes: 8 additions & 6 deletions package.json
@@ -1,7 +1,7 @@
{
"name": "micro-geoip-country",
"description": "Get country from ip",
"version": "1.0.2",
"version": "1.1.0",
"license": "MIT",
"private": true,
"author": {
Expand All @@ -11,7 +11,7 @@
},
"main": "index.js",
"engines": {
"node": ">=7.8.0"
"node": ">=8.9.0"
},
"scripts": {
"test": "standard && nsp check && ava",
Expand All @@ -20,8 +20,9 @@
"coveralls": "nyc ava && nyc report --reporter=lcov && cat coverage/lcov.info | coveralls",
"setup": "npm install",
"standard-fix": "standard --fix",
"dev": "micro-dev",
"start": "micro",
"now-deploy": "npm test && now --npm && now alias"
"deploy": "npm test && now && now alias"
},
"keywords": [
"microservice",
Expand All @@ -30,12 +31,12 @@
],
"repository": {
"type": "git",
"url": "https://github.com/zrrrzzt/micro-geoip-country.git"
"url": "git+https://github.com/zrrrzzt/micro-geoip-country.git"
},
"bugs": {
"url": "https://github.com/zrrrzzt/micro-geoip-country/issues"
},
"homepage": "https://github.com/zrrrzzt/micro-geoip-country",
"homepage": "https://github.com/zrrrzzt/micro-geoip-country#readme",
"now": {
"alias": [
"country.geoip.allthethings.win"
Expand All @@ -49,14 +50,15 @@
"ava": "0.23.0",
"axios": "0.17.0",
"coveralls": "3.0.0",
"micro-dev": "^1.3.0",
"nsp": "2.8.1",
"nyc": "11.3.0",
"standard": "10.0.3",
"test-listen": "1.0.2"
},
"dependencies": {
"ip2countrify": "0.2.0",
"marked": "0.3.6",
"markdown-it": "8.4.0",
"micro": "9.0.1"
}
}
4 changes: 3 additions & 1 deletion test/modules/dev-dependencies-test.js
Expand Up @@ -3,8 +3,10 @@
const test = require('ava')
const pkg = require('../../package.json')
const dependencies = pkg.devDependencies || {}
const dropModules = ['micro-dev']
const isDropped = (module) => !dropModules.includes(module)

Object.keys(dependencies).forEach((dependency) => {
Object.keys(dependencies).filter(isDropped).forEach((dependency) => {
test(`${dependency} loads ok`, t => {
const module = require(dependency)
t.truthy(module)
Expand Down

0 comments on commit 88107e4

Please sign in to comment.