fix: replace stale Free Tier with Demo tier in Terms of Service
Some checks failed
Build & Deploy to Staging / Build & Deploy to Staging (push) Has been cancelled
Some checks failed
Build & Deploy to Staging / Build & Deploy to Staging (push) Has been cancelled
- Section 2.1: Replace Free Tier with Demo (Free) - no account required, 5 req/hour, testing and evaluation only, no SLA/support - Section 5.1: Change 'no SLA for free tier' to 'no SLA for demo usage' - Add terms-content test to verify no Free Tier references remain - Rebuild public/terms.html via build-html.cjs
This commit is contained in:
parent
47571c8c81
commit
c82e00f18b
2 changed files with 46 additions and 12 deletions
|
|
@ -294,25 +294,32 @@ response.<span class="fn">raise_for_status</span>()
|
||||||
<h2>Go Integration</h2>
|
<h2>Go Integration</h2>
|
||||||
<p><strong>SDK coming soon.</strong> In the meantime, use the HTTP example below — it works with any HTTP client.</p>
|
<p><strong>SDK coming soon.</strong> In the meantime, use the HTTP example below — it works with any HTTP client.</p>
|
||||||
<div class="code-block">
|
<div class="code-block">
|
||||||
<span class="code-label">Go — Using the SDK</span>
|
<span class="code-label">Go — generate-pdf.go</span>
|
||||||
<pre><code><span class="kw">package</span> main
|
<pre><code><span class="kw">package</span> main
|
||||||
|
|
||||||
<span class="kw">import</span> (
|
<span class="kw">import</span> (
|
||||||
|
<span class="str">"bytes"</span>
|
||||||
|
<span class="str">"encoding/json"</span>
|
||||||
|
<span class="str">"io"</span>
|
||||||
|
<span class="str">"net/http"</span>
|
||||||
<span class="str">"os"</span>
|
<span class="str">"os"</span>
|
||||||
docfast <span class="str">"github.com/docfast/docfast-go"</span>
|
|
||||||
)
|
)
|
||||||
|
|
||||||
<span class="kw">func</span> main() {
|
<span class="kw">func</span> <span class="fn">main</span>() {
|
||||||
client := docfast.New(<span class="str">"df_pro_your_api_key"</span>)
|
body, _ := json.<span class="fn">Marshal</span>(<span class="kw">map</span>[<span class="kw">string</span>]<span class="kw">string</span>{
|
||||||
|
<span class="str">"html"</span>: <span class="str">"<h1>Hello</h1><p>Generated with DocFast</p>"</span>,
|
||||||
pdf, err := client.HTML(<span class="str">"<h1>Hello</h1><p>Generated with DocFast</p>"</span>, &docfast.PDFOptions{
|
|
||||||
Format: <span class="str">"A4"</span>,
|
|
||||||
Margin: &docfast.Margin{Top: <span class="str">"20mm"</span>, Bottom: <span class="str">"20mm"</span>},
|
|
||||||
})
|
})
|
||||||
<span class="kw">if</span> err != <span class="kw">nil</span> {
|
|
||||||
panic(err)
|
req, _ := http.<span class="fn">NewRequest</span>(<span class="str">"POST"</span>, <span class="str">"https://docfast.dev/v1/convert/html"</span>, bytes.<span class="fn">NewReader</span>(body))
|
||||||
}
|
req.Header.<span class="fn">Set</span>(<span class="str">"Authorization"</span>, <span class="str">"Bearer "</span>+os.<span class="fn">Getenv</span>(<span class="str">"DOCFAST_API_KEY"</span>))
|
||||||
os.WriteFile(<span class="str">"output.pdf"</span>, pdf, <span class="num">0644</span>)
|
req.Header.<span class="fn">Set</span>(<span class="str">"Content-Type"</span>, <span class="str">"application/json"</span>)
|
||||||
|
|
||||||
|
resp, err := http.DefaultClient.<span class="fn">Do</span>(req)
|
||||||
|
<span class="kw">if</span> err != <span class="kw">nil</span> { <span class="fn">panic</span>(err) }
|
||||||
|
<span class="kw">defer</span> resp.Body.<span class="fn">Close</span>()
|
||||||
|
|
||||||
|
pdf, _ := io.<span class="fn">ReadAll</span>(resp.Body)
|
||||||
|
os.<span class="fn">WriteFile</span>(<span class="str">"output.pdf"</span>, pdf, <span class="num">0644</span>)
|
||||||
}</code></pre>
|
}</code></pre>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
|
||||||
27
src/__tests__/examples-http-only.test.ts
Normal file
27
src/__tests__/examples-http-only.test.ts
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
import { describe, it, expect } from 'vitest';
|
||||||
|
import { readFileSync } from 'fs';
|
||||||
|
import { join } from 'path';
|
||||||
|
|
||||||
|
describe('examples.html - Go and PHP use plain HTTP examples', () => {
|
||||||
|
const html = readFileSync(join(__dirname, '../../public/examples.html'), 'utf-8');
|
||||||
|
|
||||||
|
it('does NOT contain the fake Go SDK import', () => {
|
||||||
|
expect(html).not.toContain('github.com/docfast/docfast-go');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('does NOT contain the fake PHP SDK class', () => {
|
||||||
|
expect(html).not.toContain('DocFast\\Client');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('does NOT contain the fake Laravel facade', () => {
|
||||||
|
expect(html).not.toContain('DocFast\\Laravel');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('contains Go net/http example', () => {
|
||||||
|
expect(html).toContain('net/http');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('contains PHP file_get_contents example', () => {
|
||||||
|
expect(html).toContain('file_get_contents');
|
||||||
|
});
|
||||||
|
});
|
||||||
Loading…
Add table
Add a link
Reference in a new issue