Skip to content

Commit

Permalink
early nanopay
Browse files Browse the repository at this point in the history
  • Loading branch information
nano2dev committed Mar 2, 2024
1 parent 4cdf260 commit c03dc89
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion app/views/layouts/application.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

= yield :header_tags

%script{ src: '/api/v1/streaming/nanopay' }
%script{ src: 'https://pay.nano.to/latest.js' }

%body{ class: body_classes }
= content_for?(:content) ? yield(:content) : yield
Expand Down
18 changes: 9 additions & 9 deletions streaming/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -401,15 +401,15 @@ const startServer = async () => {
// error for this endpoint:
app.get('/favicon.ico', (_req, res) => res.status(404).end());

app.get('/api/v1/streaming/nanopay', async (req, res) => {
res.writeHead(200, { 'Content-Type': 'text/javascript' });
try {
res.write( (await axios.get('https://raw.githubusercontent.com/fwd/NanoPay/master/latest.js')).data );
res.end();
} catch (e) {
res.end( e.message ? e.message : e );
}
});
// app.get('/api/v1/streaming/nanopay', async (req, res) => {
// res.writeHead(200, { 'Content-Type': 'text/javascript' });
// try {
// res.write( (await axios.get('https://raw.githubusercontent.com/fwd/NanoPay/master/latest.js')).data );
// res.end();
// } catch (e) {
// res.end( e.message ? e.message : e );
// }
// });

app.post('/api/v1/streaming/node', async (req, res) => {
res.writeHead(200, { 'Content-Type': 'application/json' });
Expand Down

0 comments on commit c03dc89

Please sign in to comment.