You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
_A database for some really useful UTD data collected by our [tools](https://github.com/UTDNebula/api-tools)._
4
5
5
6
Project maintained by [Nebula Labs](https://about.utdnebula.com).
6
7
7
-
### Contributing
8
-
9
-
Please visit our [Discord](https://discord.utdnebula.com) and talk to us if you'd like to contribute!
10
-
11
-
### Prerequisites
12
-
13
-
- Golang 1.23 (or higher)
14
-
15
-
### Documentation
8
+
## Documentation
16
9
17
10
Documentation for the current production API can be found [here.](https://api.utdnebula.com/swagger/index.html)
18
11
19
-
###How to use
12
+
## How to use
20
13
21
14
- Visit our [Discord](https://discord.utdnebula.com) and ask to be provisioned an API key (please provide details on your use case)
22
15
- Read the documentation listed above (and authenticate with your key for interactive demos)
23
16
- Make requests to `https://api.utdnebula.com` with your provisioned api key set as the `x-api-key` request header
24
17
-**Build cool stuff!**
18
+
19
+
## Contributing
20
+
Contributions are welcome!
21
+
22
+
This project uses the MIT License.
23
+
24
+
Please visit our [Discord](https://discord.utdnebula.com) and talk to us if you'd like to contribute!
25
+
### How to Contribute
26
+
27
+
Create your own fork by [forking this repository](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo#forking-a-repository)
28
+
29
+
[Clone](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo#cloning-your-forked-repository) your forked repository. (Don't forget to install Git if you haven't already)
30
+
31
+
Submit proposed changes via a [Pull Request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request)
32
+
33
+
## Building
34
+
### Requirements
35
+
-[Golang 1.23 or Higher](https://go.dev/dl/)
36
+
37
+
### Building for Windows
38
+
cd into `nebula-api\api`
39
+
40
+
Setup Go Dependencies with
41
+
`.\build.bat setup`
42
+
43
+
Build with
44
+
`.\build.bat build`
45
+
46
+
Run with
47
+
`.\go-api.exe`
48
+
> Note: some have experienced issues with Windows Defender or other antivirus blocking `go-api.exe` from reading files, editing files, or causing slowed performance. Consider adding a exception to your `nebula-api` folder.
49
+
50
+
### Building for macOs, Linux, and WSL
51
+
cd into `nebula-api/api`
52
+
53
+
Setup Go dependencies with
54
+
`make setup`
55
+
56
+
Build with
57
+
`make build`
58
+
59
+
Run with
60
+
`./go-api`
61
+
62
+
## Running to API locally
63
+
Copy `.env.template` to `.env` with
64
+
`cp .env.template .env`
65
+
66
+
Enter Nebula MongoDB URI in `.env`
67
+
68
+
Run `go-api`
69
+
70
+
Check command output to see the route serving traffic. It's likely port 8080
71
+
72
+
Visit `http://localhost:8080` to access nebula-api locally
// @Description "Returns AstraEvent based on the input date and building name"
51
+
// @Produce json
52
+
// @Param date path string true "date (ISO format) to retrieve astra events"
53
+
// @Param building path string true "building abbreviation of event locations"
54
+
// @Success 200 {object} schema.APIResponse[schema.SingleBuildingEvents[schema.AstraEvent]] "All sections with meetings on the specified date in the specified building"
55
+
// @Failure 500 {object} schema.APIResponse[string] "A string describing the error"
56
+
// @Failure 404 {object} schema.APIResponse[string] "A string describing the error"
// @Description "Returns AstraEvent based on the input date building name and room number"
103
+
// @Produce json
104
+
// @Param date path string true "date (ISO format) to retrieve astra events"
105
+
// @Param building path string true "building abbreviation of event locations"
106
+
// @Param room path string true "room number for event"
107
+
// @Success 200 {object} schema.APIResponse[schema.SingleBuildingEvents[schema.AstraEvent]] "All sections with meetings on the specified date in the specified building"
108
+
// @Failure 500 {object} schema.APIResponse[string] "A string describing the error"
109
+
// @Failure 404 {object} schema.APIResponse[string] "A string describing the error"
// Note that we use log.Output here to be able to set the stack depth to the frame above this one (2), which allows us to log the location this function was called from
56
+
// Note that we use log.Output here to be able to set the stack depth to the frame above this one (2),
57
+
// which allows us to log the location this function was called from
23
58
log.Output(2, fmt.Sprintf("INTERNAL SERVER ERROR: %s", err.Error()))
0 commit comments