Fix ‘Tests’ workflow badge in README
All of Monki Projects’ APIs specifications (including this one’s) are available in the mp-api-specs repository.
DATABASE_PORT
DATABASE_USERNAME
DATABASE_PASSWORD
DATABASE_NAME
ENABLE_JOBS
START_IN_PROCESS_JOBS
START_SCHEDULED_JOBS
Clone the repository
git clone https://github.com/MonkiProjects/monki-projects-api.git
(Recommended) Integrate SwiftLint into your Xcode project to get warnings and errors displayed in the issue navigator
swift package generate-xcodeproj open monki-projects-api.xcodeproj
Follow SwiftLint’s instructions to add a new build phase
Setup PostgreSQL (easy way for macOS)
This is the easiest way for macOS, you can do it differently if you prefer.
Download Postgres.app at postgresapp.com and install it.
Open the sidebar (if it’s not already open) by clicking on the button in the bottom-left corner.
Create a new server called “Vapor” in the directory ~/Library/Application Support/Postgres/vapor (you can put whatever you want at this step).
~/Library/Application Support/Postgres/vapor
Click Initialize
Once your server is running, double-click on the postgres database to open it.
postgres
Once in the SQL prompt, run
CREATE DATABASE vapor_database; CREATE USER vapor_username WITH PASSWORD 'vapor_password';
Close the shell (run exit to leave the SQL prompt if needed)
exit
You should see a new database called vapor_database
vapor_database
The config you should have can be found in configure.swift, but here is a recap:
5432
vapor_username
vapor_password
If you change these settings, you will need to add environment variables to your scheme’s Run and Test configurations.
Run
Test
Run the project
Two possibilities:
monki-projects-api.xcodeproj
Product > Scheme
From there, you will be able to run the project.
Stop the app
In XCode, hit the ◾ button in the top-left corner or hit ⌘+. to stop the app. If you’re running the app in a terminal, hit Ctrl+C.
Stop the PostgreSQL server
If you used Postgres.app, just open it and click Stop. Otherwise, manually stop it.
8080
For some reason, stopping the app causes an error preventing port 8080 to be closed, here is a command that kills it (tested on macOS):
lsof -t -i tcp:8080 | xargs kill
©Copyright 2023 CCF 开源发展委员会 Powered by Trustie& IntelliDE 京ICP备13000930号
Monki Projects API
Overview
All of Monki Projects’ APIs specifications (including this one’s) are available in the mp-api-specs repository.
Environment variables
DATABASE_PORT
DATABASE_USERNAME
DATABASE_PASSWORD
DATABASE_NAME
ENABLE_JOBS
START_IN_PROCESS_JOBS
START_SCHEDULED_JOBS
How To Contribute
Run the project
Clone the repository
(Recommended) Integrate SwiftLint into your Xcode project to get warnings and errors displayed in the issue navigator
Follow SwiftLint’s instructions to add a new build phase
Setup PostgreSQL (easy way for macOS)
Download Postgres.app at postgresapp.com and install it.
Open the sidebar (if it’s not already open) by clicking on the button in the bottom-left corner.
Create a new server called “Vapor” in the directory
~/Library/Application Support/Postgres/vapor
(you can put whatever you want at this step).Click Initialize
Once your server is running, double-click on the
postgres
database to open it.Once in the SQL prompt, run
Close the shell (run
exit
to leave the SQL prompt if needed)You should see a new database called
vapor_database
The config you should have can be found in configure.swift, but here is a recap:
DATABASE_PORT
5432
DATABASE_USERNAME
vapor_username
DATABASE_PASSWORD
vapor_password
DATABASE_NAME
vapor_database
Run the project
Two possibilities:
monki-projects-api.xcodeproj
, go toProduct > Scheme
and select theRun
schemeFrom there, you will be able to run the project.
Stop the app
In XCode, hit the ◾ button in the top-left corner or hit ⌘+. to stop the app. If you’re running the app in a terminal, hit Ctrl+C.
Stop the PostgreSQL server
If you used Postgres.app, just open it and click Stop. Otherwise, manually stop it.
Tips
Fix port
8080
still open after stopping the appFor some reason, stopping the app causes an error preventing port
8080
to be closed, here is a command that kills it (tested on macOS):