Skip to content
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.

Commit

Permalink
Merge branch 'release/2.0.0'
Browse files Browse the repository at this point in the history
* release/2.0.0: (28 commits)
  release 2.0.0
  Update changelog
  Drop support for Node.js v8
  upgrade embetty@^3
  test: remove test without feature
  remove unused feature
  fix: linting
  test: facebook does not provide poster images without api
  fix: update embetty for amp includes
  Update mocha to the latest version 🚀 (#49)
  Update commander to the latest version 🚀 (#50)
  require at least node>=10 (#48)
  Update eslint-plugin-node to the latest version 🚀 (#47)
  Greenkeeper/nodemon 2.0.1 (#44)
  chore(package): update dependencies
  use Node.js 12 Docker image
  add dockerignore
  chore: trigger docker
  chore: bump 1.2.6
  chore: bump 1.2.5
  ...
  • Loading branch information
pmb0 committed Feb 24, 2020
2 parents 8b1c982 + 6728d66 commit 8ae2093
Show file tree
Hide file tree
Showing 12 changed files with 607 additions and 532 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
3 changes: 3 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ module.exports = {
'indent': ['error', 2, {MemberExpression: 1 }],
'space-before-function-paren': 0
},
parserOptions: {
'ecmaVersion': 2018
},
env: {
node: true,
mocha: true,
Expand Down
27 changes: 15 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
language: node_js
sudo: false
node_js:
- '8'
- '10'
- '12'
script:
- yarn test
before_install: yarn global add greenkeeper-lockfile@1
before_script: greenkeeper-lockfile-update
after_script: greenkeeper-lockfile-upload
deploy:
provider: npm
email: [email protected]
api_key:
secure: "ec7ey2S0EsWLWAuPPQ5InIfij0llJAVfrWF/BhBtnayIr7VPVxBuR9Q63W+GE4vBQNYklxMQGqgXmzaOAtSOoiAy6XxOlqL+CodIJ/PSwdgk1RQVAfXNRRSykYa9Bt+lrIKZyxUqWZysXyGMNtD/vpBSHjI/z3VcDL/DEonUfC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EE3BkU9meD110RJFUAHfCc64YIfTJmCoa6wpOIRQ0ZoTsWlWAMayHL/k0ZFQXDRY/rGuwk8NNFndniq+J0fsVhGVQhOYk4UXxwskutSJf2LUYa3lOVF/NHni7msYbuQFFYV06pB2NekrZu3Xj2Zsjc6JEX+bLec=
- provider: npm
email: [email protected]
api_key:
secure: "FaqCdlJroVVkN498GncaLr0X3rt51Ep8LzObEx4I1/bOfbpgmr1aliDNxEB2vWQ2i1kL5r5w7mtzNx8a2VqdlVMlQshleh4un0jlA3Jl4OD7OFeckw7w1CUqlH5XaGPOUYbt44axKl2/GmsCt5DyAzDB1xxPam7Ac8icPAU40i5Px3ZqPUir2ZTJHjxikF8dI5thQCCYVJYyTyr+jJx3V9SiemWWGGn51hECltk7VWCQ7v64ZCuw7+oa5EH9zY150rDR3U9HUldl4jitQxOE3F1mjz600qC10Iaex3OYpZCHpDdUgmhXUq5pvC9pnuVdSCpo6PMR6rbsk80581T8zLd/MdAmY5jYH2YlM5bM2gyz87Y74vHQNjEXV7X7mfv0WAZEc9VKXSBhpj7WtAAJBgXpI7eZ4ohKYgVeds1PdxRZIlt/k7p03PL4gSLOYH5Io8y86wowUEiK+s6cQni1GR/6kOeIc8nRrjDR9gu07uKVYGyuOvPYFZT3PZXhSNv5U8+J4EDgPh8/m0m4hv4l4paBIhTQFsuGpDYGY5Z4PEm0qX2BmN365VTlpPwNDTCLuqzUFaBixJZg3KqMWcaCF7iQfQWdIxvjbBCC+sXNEiY5HstVXlcv/CWvff/fXYIXuwhS5f4FZwH9YUR0uvATuFjJ2jVxbjtCXP9sbdmBvZI="
on:
tags: true
repo: heiseonline/embetty-server
node_js: '10'
- provider: releases
api_key:
secure: Vo1gHWeP+02o3kTRqC5LjdowXkXmd1wgnuyzBWnYYqt3+Q2k67QxgqxzWXK1lGPKSy/1fqdnRcczd7QG81vAmCbSA6Apykr/9tYi+bSUfRpPSdlnL1Eq/GaV8zOlt8U22xxtUTiCcw6N5W89Mzi42EoYuDF4/16Y8d289lIwyZuBS61BRPpaIXCp0cLIcz9XVnxeCdAI/gtTCKMSc29CaUDYRFR8YQUvbQOsdSGDVzgDNhR+vuD5q2WJgFW/rqIIcq4oSlDVK0FmRmS21aR+s5EWxlNIs2PN/0UL3ubpnlJbMpNK0FGdnBQSORKE0y4DrQ6sLAT+dw/3UwNcpx7w486+fgkuzmsqtqnzpe8n9tMpduQYjl+6oF14xgevGDorKEr7Vy/GRThM+adfZmzpJ9z2iT6cpIC1ZvQ9hXC+dO0QRv44T30W0xB+40pI2e+9biDBOg5YEm/BD0n3KLkBFhFPSlOJSah3d0Pp4BxW+fsCHrkUehbcZ5uMuCPfgx4Rjx37uaVp81fvRL1SGLFtTz8oOPrqt1exl84MCTqdt0mSdoi9+HUUkLvFIfGM7et3x4rsb81HLGfY2cecNCqR9Vw/Hxe3SBBEoNWnpn6EmNgL/zF7zcJYuV58fEp/o7ytQnNAvAFBcepH24Xh7D6Ik2oIvN48ityHY5x+vBFyLao=
on:
repo: heiseonline/embetty-server
tags: true
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Changelog

## v2.0.0, 2020-02-24

This release contains breaking changes:

- Dropped support for Node.js v8.
- Removed support for Facebook poster images.

## v1.2.5-7, 2019-09-05

- Chore: fix travis and docker deployment

## v1.2.4, 2019-09-05

- Upgrade embetty-base, fix cloudflare error

## v1.2.3, 2019-06-11

- Upgraded dependencies.
Expand Down
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
FROM alpine:3.8
FROM node:12-alpine

ENV PORT 8080
EXPOSE 8080

RUN apk add --update --no-cache nodejs git yarn \
&& addgroup embetty && adduser embetty -D -G embetty \
RUN addgroup embetty && adduser embetty -D -G embetty \
&& mkdir /app \
&& chown -R embetty:embetty /app/

Expand Down
2 changes: 1 addition & 1 deletion bin/www
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env node

const app = require('../')
const debug = require('debug')('embetty.web:server')
const debug = require('debug')('embetty-server:www')
const http = require('http')

const port = normalizePort(process.env.PORT || '3000')
Expand Down
21 changes: 12 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@heise/embetty-server",
"version": "1.2.3",
"version": "2.0.0",
"main": "index.js",
"repository": "[email protected]:heiseonline/embetty-server.git",
"author": "Philipp Busse <[email protected]>",
Expand All @@ -10,6 +10,9 @@
"embetty": "bin/embetty",
"embetty-start": "bin/embetty-start"
},
"engine": {
"node": ">=10"
},
"scripts": {
"start": "./bin/www",
"dev": "nodemon ./bin/www",
Expand All @@ -22,20 +25,20 @@
},
"devDependencies": {
"@heise/request-promise-native-record": "^1.0.1",
"eslint": "^5.7.0",
"eslint-config-standard": "^12.0.0",
"eslint": "^6.0.0",
"eslint-config-standard": "^14.1.0",
"eslint-plugin-import": "^2.10.0",
"eslint-plugin-node": "^7.0.1",
"eslint-plugin-node": "^11.0.0",
"eslint-plugin-promise": "^4.0.1",
"eslint-plugin-standard": "^4.0.0",
"mocha": "^6.1.4",
"nodemon": "^1.12.1",
"mocha": "^7.0.1",
"nodemon": "^2.0.2",
"supertest": "^4.0.2"
},
"dependencies": {
"@heise/embetty": "^1.1.0",
"@heise/embetty-base": "^1.0.0-beta.5",
"commander": "^2.15.1",
"@heise/embetty": "^3.0.1",
"@heise/embetty-base": "^1.0.9",
"commander": "^4.1.1",
"cors": "^2.8.4",
"debug": "^4.1.0",
"express": "^4.16.2",
Expand Down
2 changes: 1 addition & 1 deletion routes/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { Forbidden } = require('../lib/exceptions')
const cors = require('cors')
const debug = require('debug')('embetty.web:server')
const debug = require('debug')('embetty-server:index')
const express = require('express')
const fs = require('fs')
const tweet = require('./tweet')
Expand Down
11 changes: 0 additions & 11 deletions routes/video/facebook.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,6 @@ router.param('id', async (req, res, next, id) => {
}
})

router.get('/:id-poster-image', async (req, res, next) => {
try {
const { data, type } = await req.video.getPosterImage()
if (!data) return next()
res.type(type)
res.send(data)
} catch (e) {
next(e)
}
})

router.get('/:id.amp', (req, res) => {
res.render('video.html', { video: req.video })
})
Expand Down
2 changes: 1 addition & 1 deletion test/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('CLI', () => {
const { stderr } = spawnSync(embettyBin, ['start', '--debug'], { timeout: 3000 })
const out = stderr.toString()
assert.ok(out.includes('express:router'))
assert.ok(out.includes('embetty.base'))
assert.ok(out.includes('embetty-base'))
})

it('embetty start --cache <cache>', () => {
Expand Down
18 changes: 3 additions & 15 deletions test/video.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('Video', () => {

it('should support AMP', async () => {
const response = await request(app)
.get(`/video/youtube/m6UOo2YGbIE.amp`)
.get('/video/youtube/m6UOo2YGbIE.amp')
.expect('Content-Type', /html/)
.expect(200)
const expected = '<embetty-video type="youtube" video-id="m6UOo2YGbIE"></embetty-video>'
Expand Down Expand Up @@ -54,7 +54,7 @@ describe('Video', () => {

it('should support AMP', async () => {
const response = await request(app)
.get(`/video/vimeo/223099532.amp`)
.get('/video/vimeo/223099532.amp')
.expect('Content-Type', /html/)
.expect(200)
const expected = '<embetty-video type="vimeo" video-id="223099532"></embetty-video>'
Expand Down Expand Up @@ -89,23 +89,11 @@ describe('Video', () => {

it('should support AMP', async () => {
const response = await request(app)
.get(`/video/facebook/10156049485672318.amp`)
.get('/video/facebook/10156049485672318.amp')
.expect('Content-Type', /html/)
.expect(200)
const expected = '<embetty-video type="facebook" video-id="10156049485672318"></embetty-video>'
assert.ok(response.text.includes(expected))
})

it('should provide the poster image', async () => {
const response = await request(app)
.get('/video/facebook/10156049485672318-poster-image')
.expect('Content-Type', /jpeg/)
.expect(200)

assert.ok(Buffer.isBuffer(response.body))
const imageLength = Buffer.byteLength(response.body)
assert.ok(imageLength > 100)
assert.strictEqual(response.headers['content-length'], `${imageLength}`)
})
})
})
Loading

0 comments on commit 8ae2093

Please sign in to comment.