Skip to content

Commit 5be9e79

Browse files
authored
Merge pull request #198 from MichaelPereira/api-auth-instructions
Add instructions for API auth
2 parents 46ae36a + 3939890 commit 5be9e79

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,16 @@ It also acts as the webserver to serve the front end react application
9898

9999
All api actions are accessible with the /api route. The frontend is accessible from /.
100100

101+
### API Auth
102+
103+
To authenticate with the API and get access to its functionality, you need to login first.
104+
105+
Here is a small example showing how to do it with a local install using default credentials, via the tool curl:
106+
```
107+
curl --cookie-jar cookie.txt --insecure --data '{"username":"admin","password":"factorio"}' -H "Content-Type: application/json" -X POST https://localhost/api/login
108+
curl --cookie cookie.txt --insecure https://localhost/api/server/status
109+
```
110+
101111
#### Requirements
102112
+ Go 1.11
103113
+ NodeJS

0 commit comments

Comments
 (0)