Skip to content

Commit

Permalink
Updating packages, moving functions
Browse files Browse the repository at this point in the history
  • Loading branch information
karllhughes committed Sep 18, 2019
1 parent a63959d commit 88749fd
Show file tree
Hide file tree
Showing 10 changed files with 3,840 additions and 5,915 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ config.json
output/*
!.gitkeep
coverage/
webtask/package-lock.json
package-lock.json
docs/_site
2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
docs/
webtask/
functions/
19 changes: 19 additions & 0 deletions functions/rss-to-email/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const RssToEmail = require('rss-to-email');

module.exports = (request, response) => {
console.log(request.query);
console.log(request.body);

// Previous code
// const config = req.body || {};
// const rssToEmail = RssToEmail(config);
// rssToEmail.getEmail(config.format || 'html')
// .then(email => {
// res.writeHead(200, {
// 'Content-Type': 'text/html ',
// });
// res.end(email);
// });

return response.send('It works!');
};
3 changes: 3 additions & 0 deletions functions/rss-to-email/now.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"builds": [{ "src": "index.js", "use": "@now/node" }]
}
11 changes: 11 additions & 0 deletions functions/rss-to-email/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "rss-to-email-function",
"version": "0.1.0",
"main": "index.js",
"dependencies": {
"rss-to-email": "^0.9.0"
},
"devDependencies": {
"@now/node": "^1.0.0"
}
}
2 changes: 1 addition & 1 deletion webtask/readme.md → functions/rss-to-email/readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# RSS To Email Webtask
# RSS To Email - Zeit Now

Because this service currently won't work in the browser, we've created a [Webtask](https://webtask.io/) to make it easy to deploy your own microservice. Just sign up for an account, download the [Webtask CLI](https://webtask.io/docs/wt-cli), and run the webtask from this subdirectory:

Expand Down
Loading

0 comments on commit 88749fd

Please sign in to comment.