Skip to content

Commit

Permalink
Add dockerfile and documentation in root path.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexlangberg committed Oct 26, 2018
1 parent 1d6c191 commit 39008f9
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
npm-debug.log
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM node:10

# Create app directory
WORKDIR /usr/src/app

# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY package*.json ./

RUN npm install --only=production
# If you are building your code for production
# RUN npm install --only=production

# Bundle app source
COPY . .

EXPOSE 4201
CMD [ "npm", "start" ]
1 change: 0 additions & 1 deletion bin/feed2json-server
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const feed2jsonServer = require('../lib/index.js');

const server = feed2jsonServer({
port: 4201,
host: 'localhost',
routes: { cors: true }
});

Expand Down
14 changes: 14 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,20 @@ const getServer = (hapiOptions) => {
})
};

server.route({
method: 'GET',
path: '/',
handler: () => {
return {
description: "This is a feed2json conversion service. It can be used to convert rss feeds in xml format to the jsonfeed standard.",
example: `/example`,
conversion: `/convert?url=http://feeds.reuters.com/reuters/topNews`,
github: "https://github.com/alexlangberg/node-feed2json-server",
npm: "https://www.npmjs.com/package/feed2json-server",
}
}
});

server.route({
method: 'GET',
path: '/example',
Expand Down

0 comments on commit 39008f9

Please sign in to comment.