Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Production Ready #5

Open
masterbee opened this issue Apr 15, 2015 · 2 comments
Open

Production Ready #5

masterbee opened this issue Apr 15, 2015 · 2 comments

Comments

@masterbee
Copy link

Hi @githubjeka,

I am still learning Yii2 and was looking at this repo for a quick startup and way to implement quickly. I noticed that on the php init there was only the development option available. Just wondering if you consider this codebase stable enough for production environments?

@githubjeka
Copy link
Owner

Hi.
You can get prod env from yii2-app-advanced/environments/prod/
Only you should add headers to rest index. See https://github.com/githubjeka/yii2-rest/blob/master/environments/dev/rest/web/index.php#L2

@githubjeka
Copy link
Owner

In fact

defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'dev');

to

defined('YII_DEBUG') or define('YII_DEBUG', false);
defined('YII_ENV') or define('YII_ENV', 'prod');

and need to add

header("Access-Control-Allow-Origin: *");
header('Access-Control-Allow-Methods: POST, GET, PUT, DELETE, OPTIONS ');
header('Access-Control-Allow-Headers: Content-Type, Authorization');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants