Skip to content

Commit

Permalink
React new app and remove old one with common fragment (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
morriq authored Dec 9, 2018
1 parent 669a7f8 commit 501aea0
Show file tree
Hide file tree
Showing 64 changed files with 1,520 additions and 27,931 deletions.
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ createServer((request, response) => {
response.writeHead(200, { 'Content-Type': 'image/x-icon' })
response.end('')
return
} else if (request.url !== '/') {
return;
}

request.headers['x-request-uri'] = request.url
Expand Down
18 changes: 0 additions & 18 deletions microservices.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,6 @@ const filterReqHeadersFn = require('node-tailor/lib/filter-headers.js')
module.exports = ({ agent }, tracer) => {
return new Tailor({
handledTags: ['script'],
handleTag(request, tag, options, context) {
if (tag.attributes && tag.attributes.type === 'tailor/plugin') {
return `<script>
(function (d) {
var i;
require(d);
var arr = ['react', 'react-dom', 'react-redux', 'redux', 'prop-types', 'classnames', 'vue', 'vuex', 'axios'];
while (i = arr.pop()) (function (dep) {
define(dep, d, function (b) {
return b[dep];
})
})(i);
}(['${context['service-common'].src}/dist/bundle.js']));
</script>`
}

return ''
},
filterRequestHeaders(attributes, request) {
return {
...filterReqHeadersFn(attributes, request),
Expand Down
Loading

0 comments on commit 501aea0

Please sign in to comment.