<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — Issue With Cors in API Module]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=10376&amp;type=atom" />
	<updated>2023-09-23T03:30:30Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=10376</id>
		<entry>
			<title type="html"><![CDATA[Re: Issue With Cors in API Module]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=42595#p42595" />
			<content type="html"><![CDATA[<p>To be with react, i am not sure. But with node you can try express and cors together. </p><div class="codebox"><pre><code>const express = require(&#039;express&#039;);
const cors = require(&#039;cors&#039;);

const app = express();

// Allow requests from all origins (for development purposes)
app.use(cors());</code></pre></div><p>I meant I am trying to make a rest api with slim 4 and instead of username and password for every call. Trying to do with access token based authentication. </p><p>First time they need to login with email and password and response will provide&nbsp; a token. And based on that token further api calls so operate.</p>]]></content>
			<author>
				<name><![CDATA[kvvaradha]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19348</uri>
			</author>
			<updated>2023-09-23T03:30:30Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=42595#p42595</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Issue With Cors in API Module]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=42593#p42593" />
			<content type="html"><![CDATA[<p>I think it is built on react technology so the guy needs to access the API through browser. The CORS error is specific with browser and not with POSTMAN.</p><p>Your second point I couln&#039;t get. The above mentioned gihub link for module for API is on SLIM3 or SLIM4 I couldn&#039;t ge this?</p>]]></content>
			<author>
				<name><![CDATA[boxygen]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=20175</uri>
			</author>
			<updated>2023-09-22T20:03:25Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=42593#p42593</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Issue With Cors in API Module]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=42577#p42577" />
			<content type="html"><![CDATA[<p>You are trying in the browser. Try post man or similar to this .</p><br /><p>And also slim 3 has been used on this api.&nbsp; Currently we are trying with slim 4 and access token based authentication.</p>]]></content>
			<author>
				<name><![CDATA[kvvaradha]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19348</uri>
			</author>
			<updated>2023-09-19T11:34:10Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=42577#p42577</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Issue With Cors in API Module]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=42573#p42573" />
			<content type="html"><![CDATA[<p><a href="https://github.com/cambell-prince/FrontAccountingSimpleAPI">https://github.com/cambell-prince/Front … gSimpleAPI</a></p><p>This is API module above that we are using to integrate with with our external React App.</p><p>The issue regarding this module is that whenever we try to make an API request to any endpoint provided in this module </p><p>i.e: www.baseurl.com/modules/api/category</p><p>it always gives an error regarding Allowed Origin not present in headers (CORS) but on the other hand when we are trying the same exact endpoint with Postman it runs as it is supposed to run.</p><p>I have gone through the help at slim framework site and found the solution below. But I am not sure where to embed this code in our API module.</p><p><a href="https://www.slimframework.com/docs/v3/cookbook/enable-cors.html">https://www.slimframework.com/docs/v3/c … -cors.html</a></p><br /><p>Kindly help us resolve this issue</p><p>Thanks for helping and coorperating.</p>]]></content>
			<author>
				<name><![CDATA[asfandkhan]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=47138</uri>
			</author>
			<updated>2023-09-18T08:01:59Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=42573#p42573</id>
		</entry>
</feed>
