Skip to content
Snippets Groups Projects
Commit afc877c8 authored by Sibidharan's avatar Sibidharan :speech_balloon:
Browse files

Server Setup Class

parent b08adef2
No related branches found
No related tags found
No related merge requests found
......@@ -18,4 +18,30 @@ Right outside the document root, create a file called `env.json` and keep the co
This will be called by the API functions to get the database connection.
This project is under development.
\ No newline at end of file
This project is under development.
#### Virtual Host Apache Configuration:
```
<VirtualHost *:80>
ServerAdmin hello@sibidharan.me
DocumentRoot "/var/www/api-development-course-apr-2021"
ServerName api1.selfmade.ninja
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory "/var/www/api-development-course-apr-2021">
Options Indexes FollowSymLinks ExecCGI Includes
AllowOverride All
Require all granted
</Directory>
# Added automatically by LetsEncrypt
RewriteEngine on
RewriteCond %{SERVER_NAME} =api1.selfmade.ninja
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=307]
</VirtualHost>
```
......@@ -63,7 +63,7 @@ class API extends REST {
private function about(){
if($this->get_request_method() != "POST"){
$error = array('status' => 'WRONG_CALL', "msg" => "The type of call cannot be accepted by our servers.");
$error = array('method'=> $this->get_request_method(), 'status' => 'WRONG_CALL', "msg" => "The type of call cannot be accepted by our servers.");
$error = $this->json($error);
$this->response($error,406);
}
......@@ -111,10 +111,6 @@ class API extends REST {
$this->response($data,200);
}
}
/*************API SPACE END*********************/
/*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment